:root {
    /* Color Palette */
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --accent-secondary: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #34495e;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 25px rgba(0, 0, 0, 0.12);
    --shadow-3d: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s ease;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-full: 50%;
    --section-padding: 100px 0;
    --container-width: 1200px;
    
    /* Book Variables */
    --book-width: 900px;
    --book-height: 600px;
    --book-page-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --page-flip-duration: 700ms;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* ===== DIGITAL BOOK CONTAINER ===== */
.book-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    perspective: 1200px;
}

.book-wrapper {
    position: relative;
    width: 100%;
    background: transparent;
}

/* ===== BOOK PAGES CONTAINER ===== */
.book-pages {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    max-width: 900px;
    margin: 0 auto;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* ===== INDIVIDUAL BOOK PAGE STYLING ===== */
.book-page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--white);
    border-radius: 2px;
    box-shadow: var(--book-page-shadow);
    opacity: 0;
    transform-origin: center center;
    transform: translateX(100%) rotateY(180deg);
    transition: all var(--page-flip-duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backface-visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

/* Active page styling */
.book-page.active {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
    pointer-events: auto;
    z-index: 10;
}

/* Previous page (exiting) */
.book-page.prev {
    transform: translateX(-100%) rotateY(-180deg);
    opacity: 0;
}

/* Prevent page flickering during animation */
.book-page.flipping {
    transition: none;
}

/* ===== PAGE CONTENT STYLING ===== */
.page-content {
    padding: 60px 50px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-height: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--accent-secondary);
    padding-bottom: 20px;
}

.page-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

/* ===== COVER PAGE ===== */
.cover-page {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(26, 188, 156, 0.05) 100%);
    justify-content: space-between !important;
}

.cover-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 50px;
}

.cover-spacer {
    flex: 0.3;
}

.cover-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.cover-profile {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--secondary-color);
    box-shadow: 0 10px 40px rgba(52, 152, 219, 0.3);
    animation: gentle-float 3s ease-in-out infinite;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-name {
    font-size: 2.5rem;
    text-align: center;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cover-title {
    font-size: 1.3rem;
    text-align: center;
    color: var(--secondary-color);
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.cover-tagline {
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

.cover-footer {
    flex: 0.4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.btn-open-book {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-secondary));
    color: var(--white);
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-open-book:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ===== BACK COVER PAGE ===== */
.back-cover-page {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(26, 188, 156, 0.08) 100%);
    justify-content: space-between !important;
}

.back-cover-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 50px;
    height: 100%;
}

.back-cover-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.back-cover-main h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

.back-cover-main p {
    max-width: 90%;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.8;
}

.closing-tagline {
    font-size: 1.1rem !important;
    font-weight: 600;
    color: var(--secondary-color) !important;
    margin-top: 10px !important;
}

.back-cover-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.back-cover-footer p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 2px 0;
}

/* ===== PAGE NAVIGATION ===== */
.book-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: var(--white);
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    color: var(--white);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--text-light);
    color: var(--text-light);
}

.page-counter {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
    text-align: center;
}

.current-page {
    color: var(--secondary-color);
    font-weight: 700;
}

/* ===== PAGE NUMBERS NAVIGATION ===== */
.page-numbers-nav {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.page-numbers-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number {
    width: 45px;
    height: 45px;
    border: 2px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.page-number.active {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* ===== BUTTON STYLES FOR BOOK PAGES ===== */
.btn {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid var(--secondary-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--accent-secondary);
    z-index: -1;
    transition: var(--transition);
}

.btn:hover::after {
    width: 100%;
}

.btn:hover {
    color: var(--white);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    color: var(--white);
}

/* ===== SKILLS GRID IN BOOK ===== */
.skills-grid-book {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.skill-item-book {
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    text-align: center;
}

.skill-icon-book {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 auto 12px;
}

.skill-item-book h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.skill-item-book p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===== LEARNING GRID IN BOOK ===== */
.learning-grid-book {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

.learning-item-book {
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.learning-icon-book {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.learning-item-book h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.learning-item-book p {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 12px;
}

.progress-bar-book {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-book .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* ===== PROJECTS GRID IN BOOK ===== */
.projects-grid-book {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

.project-item-book {
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.project-item-book h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.project-category {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 8px !important;
}

.project-item-book p {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 12px;
}

.project-tech-book {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.project-tech-book span {
    background: rgba(52, 152, 219, 0.2);
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-links a {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-links a:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* ===== CV SUMMARY IN BOOK ===== */
.cv-summary-book {
    font-size: 0.9rem;
    line-height: 1.7;
}

.cv-summary-book p {
    margin-bottom: 16px;
    color: var(--text-color);
}

.cv-summary-book h3 {
    font-size: 1.05rem;
    margin-top: 20px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.strengths-list-book {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.strengths-list-book div {
    padding: 8px 12px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ===== EDUCATION IN BOOK ===== */
.education-book {
    font-size: 0.9rem;
    line-height: 1.7;
}

.education-book h3 {
    font-size: 1.05rem;
    margin-top: 20px;
    margin-bottom: 12px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.education-book h3 i {
    color: var(--secondary-color);
}

.education-item, .certification-item {
    padding: 12px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
}

.education-item p, .certification-item p {
    font-size: 0.85rem;
    color: var(--text-color);
    margin: 4px 0;
}

.degree, .university {
    font-weight: 600;
    color: var(--primary-color) !important;
}

.university {
    font-weight: normal !important;
    color: var(--text-light) !important;
}

/* ===== CONTACT GRID IN BOOK ===== */
.contact-grid-book {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-info-book h3, .contact-form-book h3 {
    font-size: 1.05rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.contact-item-book {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.contact-item-book i {
    font-size: 1.1rem;
    color: var(--secondary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-item-book div p {
    font-size: 0.8rem;
    margin: 0;
}

.contact-item-book .label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.75rem !important;
}

.contact-item-book a {
    color: var(--secondary-color);
    text-decoration: none;
}

.contact-item-book a:hover {
    text-decoration: underline;
}

.contact-form-book form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ===== SOCIAL SECTION IN BOOK ===== */
.social-section-book {
    text-align: center;
}

.social-intro {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.social-icons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.social-card {
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: var(--secondary-color);
}

.social-card:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-5px);
}

.social-card i {
    font-size: 1.5rem;
}

.social-card span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cv-download-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cv-download-section h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet: 768px and below */
@media (max-width: 768px) {
    :root {
        --book-width: 100%;
        --book-height: auto;
    }
    
    body {
        padding: 10px;
    }
    
    .book-pages {
        aspect-ratio: 9 / 12;
        max-width: 100%;
    }
    
    .page-content {
        padding: 40px 25px;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .book-navigation {
        gap: 20px;
    }
    
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .page-numbers-container {
        gap: 8px;
    }
    
    .page-number {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .skills-grid-book, .strengths-list-book {
        grid-template-columns: 1fr;
    }
    
    .contact-grid-book {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .social-icons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .cover-name {
        font-size: 1.8rem;
    }
    
    .cover-title {
        font-size: 1rem;
    }
}

/* Mobile: 480px and below */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .book-pages {
        aspect-ratio: 1 / 1.4;
    }
    
    .page-content {
        padding: 30px 15px;
    }
    
    .page-header {
        margin-bottom: 20px;
    }
    
    .page-header h2 {
        font-size: 1.2rem;
    }
    
    .book-navigation {
        gap: 12px;
        margin-top: 20px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .page-counter {
        font-size: 0.85rem;
        min-width: 70px;
    }
    
    .page-numbers-container {
        gap: 6px;
    }
    
    .page-number {
        width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }
    
    .social-icons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .social-card i {
        font-size: 1.2rem;
    }
    
    .cover-profile {
        width: 100px;
        height: 100px;
    }
    
    .cover-name {
        font-size: 1.3rem;
    }
    
    .cover-title {
        font-size: 0.9rem;
    }
    
    .back-cover-main h2 {
        font-size: 1.3rem;
    }
    
    .back-cover-main p {
        font-size: 0.8rem;
    }
}

/* ===== ACCESSIBILITY: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .book-page {
        transition: opacity 0.3s ease;
    }
    
    .book-page.active {
        transform: translateX(0) rotateY(0deg);
    }
    
    .book-page.prev {
        transform: translateX(-100%) rotateY(-180deg);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        display: block;
    }
    
    .book-container,
    .book-navigation,
    .page-numbers-nav {
        display: none !important;
    }
}
