/* Dark Modern Theme - Uber/Apple iOS Inspired */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #000000;
    height: 100vh;
    overflow: hidden;
    color: #ffffff;
    perspective: 2000px;
}

.book-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.book {
    width: 900px;
    height: 600px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.book.closed {
    transform: rotateY(0deg) scale(0.95);
}

.book.opening {
    transform: rotateY(-15deg) scale(1);
}

.book.open {
    transform: rotateY(-25deg) scale(1.02);
}

.page {
    width: 450px;
    height: 600px;
    position: absolute;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transform-origin: left center;
    backface-visibility: hidden;
    overflow: hidden;
    transition: transform 1.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.02) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
    z-index: 1;
    transition: background 0.3s ease;
}

.page.turning-forward::before,
.page.turning-backward::before {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    transition: background 0.3s ease;
}



.page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(to left, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.1) 50%,
        transparent 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease;
    border-radius: 0 10px 10px 0;
}

.page.turning-forward::after,
.page.turning-backward::after {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-left {
    left: 0;
    transform: rotateY(0deg);
    z-index: 2;
}

.page-right {
    right: 0;
    transform: rotateY(0deg);
    z-index: 1;
}

.page.turning-forward {
    z-index: 10;
    animation: pageSlideForward 1.5s ease-in-out forwards;
}

.page.turning-backward {
    z-index: 10;
    animation: pageSlideBackward 1.5s ease-in-out forwards;
}

@keyframes pageSlideForward {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        transform: translateX(-30px) scale(0.95);
        opacity: 0.7;
        filter: brightness(0.8);
    }
    100% {
        transform: translateX(-450px) scale(0.9);
        opacity: 0;
        filter: brightness(0.6);
    }
}

@keyframes pageSlideBackward {
    0% {
        transform: translateX(-450px) scale(0.9);
        opacity: 0;
        filter: brightness(0.6);
    }
    50% {
        transform: translateX(-30px) scale(0.95);
        opacity: 0.7;
        filter: brightness(0.8);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}



.page-turn-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 30%,
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 70%,
        transparent 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.8s ease;
    border-radius: 10px;
}

.page-turn-overlay.active {
    opacity: 1;
}

.page-content {
    padding: 25px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 2;
    /* Custom scrollbar for dark theme */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.page-content::-webkit-scrollbar {
    width: 6px;
}

.page-content::-webkit-scrollbar-track {
    background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.hidden-slides {
    display: none;
}

.slide {
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide h1 {
    color: #ffffff;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    background: linear-gradient(135deg, #007AFF, #34C759);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.slide h2 {
    color: #ffffff;
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.slide h3 {
    color: #007AFF;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 20px;
}

.slide p {
    color: #e5e5e7;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 12px;
    font-weight: 400;
}

.slide ul {
    color: #e5e5e7;
    font-size: 0.95em;
    line-height: 1.6;
    margin-left: 18px;
    margin-bottom: 18px;
}

.slide li {
    margin-bottom: 6px;
    position: relative;
}

.slide li::before {
    content: '•';
    color: #007AFF;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    text-align: left;
}

th {
    background: linear-gradient(135deg, #007AFF, #0051D5);
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.subtitle {
    color: #86868b;
    font-size: 1em;
    text-align: center;
    margin-top: 8px;
    font-weight: 400;
}

.objective-box {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2), rgba(52, 199, 89, 0.2));
    border: 1px solid rgba(0, 122, 255, 0.3);
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin: 18px 0;
    font-size: 1em;
    line-height: 1.6;
    backdrop-filter: blur(10px);
}

.user-story {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #34C759;
    padding: 15px;
    margin: 12px 0;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.user-story h4 {
    color: #34C759;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1em;
}

.acceptance-criteria {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.competencies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.competency-card {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.2), rgba(108, 92, 231, 0.2));
    border: 1px solid rgba(162, 155, 254, 0.3);
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.competency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(162, 155, 254, 0.3);
}

.final-quote {
    background: linear-gradient(135deg, rgba(253, 121, 168, 0.2), rgba(232, 67, 147, 0.2));
    border: 1px solid rgba(253, 121, 168, 0.3);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.6;
    font-style: italic;
    backdrop-filter: blur(10px);
}

.navigation {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #007AFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.slide-counter {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.emoji {
    font-size: 1.2em;
    margin-right: 8px;
}

.cover-slide {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.cover-slide h1 {
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #007AFF, #34C759, #FF9500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}

.cover-slide h2 {
    color: #007AFF;
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: 25px;
}

.book-spine {
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    background: linear-gradient(to bottom, #1a1a1a, #2d2d2d);
    border-radius: 2px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.page-number {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: #86868b;
    font-size: 0.8em;
    font-weight: 500;
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .book {
        width: 85%;
        height: 85vh;
        max-width: 800px;
        transform: rotateY(0deg) scale(0.95);
    }
    
    .book.opening {
        transform: rotateY(-10deg) scale(0.95);
    }
    
    .book.open {
        transform: rotateY(-20deg) scale(0.98);
    }
    
    .page {
        width: 400px;
        height: 85vh;
        max-height: 550px;
    }
    
    .page-content {
        padding: 20px;
        font-size: 0.95em;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    
    .book-container {
        padding: 15px 10px;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .book {
        width: 95%;
        height: 75vh;
        max-width: 600px;
        max-height: 500px;
        transform: rotateY(0deg) scale(1);
        position: relative;
    }
    
    .book.closed,
    .book.opening,
    .book.open {
        transform: rotateY(0deg) scale(1);
    }
    
    .page {
        width: 50%;
        height: 75vh;
        max-height: 500px;
        position: relative;
        float: left;
        border-radius: 10px 10px 10px 10px;
    }
    
    .page-left {
        display: none; /* Hide left page on tablets for better content visibility */
    }
    
    .page-right {
        width: 100%;
        float: none;
        position: relative;
        right: auto;
    }
    
    .book-spine {
        display: none; /* Hide book spine on tablets and mobile */
    }
    
    .page-content {
        padding: 20px 15px;
        font-size: 0.9em;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .slide h1 {
        font-size: 1.8em;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .slide h2 {
        font-size: 1.5em;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .slide h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .competencies {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .competency-card {
        padding: 12px;
        font-size: 0.85em;
    }
    
    table {
        font-size: 0.8em;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        width: 100%;
        border: 0;
    }
    
    table thead,
    table tbody,
    table tr {
        display: block;
    }
    
    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    table tr {
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px;
        position: relative;
        background: rgba(255, 255, 255, 0.02);
    }
    
    table td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
        padding-left: 50%;
        white-space: normal;
        text-align: left;
        display: block;
        min-width: auto;
    }
    
    table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #007AFF;
    }
    
    th, td {
        padding: 8px 6px;
        min-width: 80px;
    }
    
    .user-story {
        padding: 12px;
        margin: 10px 0;
    }
    
    .objective-box {
        padding: 15px;
        margin: 15px 0;
        font-size: 0.95em;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .book-container {
        padding: 10px 5px;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .slide-counter {
        font-size: 0.85em;
        top: 10px;
        right: 10px;
        padding: 6px 12px;
    }
    
    .book {
        width: 98%;
        height: 80vh;
        max-height: 450px;
        max-width: 100%;
    }
    
    .page {
        height: 80vh;
        max-height: 450px;
        border-radius: 8px;
    }
    
    .page-content {
        padding: 15px 12px;
        font-size: 0.8em;
        height: 100%;
        overflow-y: auto;
    }
    
    .slide h1 {
        font-size: 1.5em;
        line-height: 1.1;
        margin-bottom: 12px;
    }
    
    .slide h2 {
        font-size: 1.3em;
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .slide h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .slide p {
        font-size: 0.9em;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .competencies {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .competency-card {
        padding: 10px;
        font-size: 0.8em;
        text-align: left;
    }
    
    table {
        font-size: 0.7em;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
    }
    
    th, td {
        padding: 6px 4px;
        min-width: 60px;
        font-size: 0.75em;
    }
    
    .user-story {
        padding: 10px;
        margin: 8px 0;
    }
    
    .user-story h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .objective-box {
        padding: 12px;
        margin: 12px 0;
        font-size: 0.9em;
        line-height: 1.5;
    }
    
    .acceptance-criteria {
        padding: 10px;
        margin: 6px 0;
        font-size: 0.85em;
    }
    
    .subtitle {
        font-size: 0.9em;
        margin-top: 10px;
    }
    
    /* Ensure emoji don't break layout on mobile */
    .emoji {
        font-size: 0.8em;
        margin-right: 5px;
    }
    
    /* Navigation improvements for mobile */
    .navigation {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        gap: 10px;
        padding: 0;
        width: auto;
        max-width: calc(100% - 20px);
    }
    
    .nav-btn {
        padding: 12px 20px;
        font-size: 0.9em;
        border-radius: 20px;
        min-width: 100px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .slide-counter {
        top: 15px;
        right: 15px;
        padding: 8px 15px;
        font-size: 0.9em;
        border-radius: 15px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .book-container {
        padding: 5px;
    }
    
    .book {
        width: 100%;
        height: 85vh;
        max-height: 400px;
    }
    
    .page {
        height: 85vh;
        max-height: 400px;
    }
    
    .page-content {
        padding: 12px 8px;
        font-size: 0.75em;
    }
    
    .slide h1 {
        font-size: 1.3em;
    }
    
    .slide h2 {
        font-size: 1.2em;
    }
    
    .slide h3 {
        font-size: 1em;
    }
    
    table {
        font-size: 0.65em;
    }
    
    th, td {
        padding: 4px 2px;
        min-width: 50px;
    }
    
    .competency-card {
        padding: 8px;
        font-size: 0.75em;
    }
    
    .navigation {
        bottom: 10px;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 0.85em;
        min-width: 80px;
    }
    
    .slide-counter {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .book-container {
        height: 100vh;
        padding: 5px;
    }
    
    .book {
        height: 95vh;
        max-height: 350px;
        width: 90%;
    }
    
    .page {
        height: 95vh;
        max-height: 350px;
    }
    
    .page-content {
        font-size: 0.75em;
        padding: 10px;
    }
    
    .navigation {
        bottom: 5px;
    }
    
    .slide-counter {
        top: 5px;
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* Touch and interaction improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px;
    }
    
    /* Smooth scrolling for content */
    .page-content {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Disable text selection on navigation elements */
    .slide-counter {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Improve table scrolling on mobile */
    table {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better hover states for touch devices */
    .competency-card:hover {
        transform: none;
    }
    
    .competency-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Aspect ratio based adjustments */
@media (max-width: 768px) and (max-aspect-ratio: 3/4) {
    /* For very tall screens, reduce book height more */
    .book {
        height: 70vh !important;
        max-height: 420px !important;
    }
    
    .page {
        height: 70vh !important;
        max-height: 420px !important;
    }
}

@media (max-width: 480px) and (max-aspect-ratio: 3/4) {
    /* For very tall mobile screens */
    .book {
        height: 65vh !important;
        max-height: 380px !important;
    }
    
    .page {
        height: 65vh !important;
        max-height: 380px !important;
    }
    
    .page-content {
        font-size: 0.75em;
    }
}
