/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1419;
    min-height: 100vh;
    overflow-x: hidden;
    color: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.site-header {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #1a2332 0%, #0f1419 100%);
    border-bottom: 2px solid #00aeef;
    box-shadow: 0 4px 20px rgba(0, 174, 239, 0.3);
    z-index: 100;
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
    object-fit: cover;
}

/* Background gradient adjusted to complement header */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 174, 239, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 174, 239, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, #0f1419 0%, #1a2332 50%, #0f1419 100%);
    z-index: -1;
}

/* Login Screen Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 25, 0.95);
    z-index: 2000;
    backdrop-filter: blur(20px);
}

.login-box {
    background: rgba(26, 35, 50, 0.9);
    border: 1px solid rgba(0, 174, 239, 0.2);
    border-radius: 20px;
    padding: 60px 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 174, 239, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h2 {
    font-size: 2.5em;
    font-weight: 200;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #00aeef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 174, 239, 0.3));
}

.login-subtitle {
    text-align: center;
    color: #8ea3b8;
    font-size: 0.9em;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: #8ea3b8;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(15, 20, 25, 0.5);
    border: 1px solid rgba(0, 174, 239, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1em;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #00aeef;
    background: rgba(0, 174, 239, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}

.form-input::placeholder {
    color: #556477;
}

.login-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00aeef 0%, #0095d0 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 174, 239, 0.3);
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 174, 239, 0.5);
}

.login-button:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9em;
    display: none;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #556477;
    font-size: 0.8em;
}

/* Lock icon */
.lock-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    position: relative;
}

.lock-body {
    width: 40px;
    height: 30px;
    background: #00aeef;
    border-radius: 5px;
    position: absolute;
    bottom: 0;
    left: 10px;
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.5);
}

.lock-shackle {
    width: 26px;
    height: 20px;
    border: 3px solid #00aeef;
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    position: absolute;
    top: 0;
    left: 17px;
}

/* Login animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    animation: slideIn 0.6s ease-out;
}

/* Hide main content initially */
.main-content-hidden {
    display: none !important;
}

/* Main Content Styles */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
    flex: 1;
}

h1 {
    text-align: center;
    font-size: 3.5em;
    font-weight: 200;
    letter-spacing: -2px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #00aeef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #8ea3b8;
    font-size: 1.1em;
    margin-bottom: 60px;
    font-weight: 300;
}

/* Modern bookshelf container */
.bookshelf-unit {
    background: rgba(26, 35, 50, 0.4);
    border: 1px solid rgba(0, 174, 239, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Individual shelf */
.shelf {
    position: relative;
    margin-bottom: 60px;
    padding: 20px 0 40px;
}

.shelf:last-child {
    margin-bottom: 0;
}

/* Book container */
.books-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    padding: 0 20px 60px;
    height: 310px;
    position: relative;
}

/* Book wrapper for 3D effect */
.book-item {
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    perspective: 1000px;
}

/* Card base for each book */
.book-card {
    position: relative;
    background: rgba(26, 35, 50, 0.6);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 -1px 0 rgba(0, 0, 0, 0.3) inset;
    border: 1px solid rgba(0, 174, 239, 0.1);
    backdrop-filter: blur(10px);
    transform: translateZ(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-item:hover .book-card {
    transform: translateZ(40px) translateY(-15px);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 174, 239, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(0, 174, 239, 0.3);
}

/* Book container with 3D sides */
.book-3d {
    position: relative;
    width: 240px;
    height: 210px;
    transform-style: preserve-3d;
    transform: rotateY(-5deg);
    transition: transform 0.4s ease;
}

.book-item:hover .book-3d {
    transform: rotateY(-15deg) rotateX(5deg);
}

/* Book front (the embed) */
.book-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 0 5px 5px 0;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(0, 174, 239, 0.2),
        0 5px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Book spine (left side) */
.book-spine {
    position: absolute;
    left: -40px;
    top: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, #1a2332 0%, #2a3342 100%);
    transform-origin: right center;
    transform: rotateY(-90deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px 0 0 5px;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        inset 2px 0 4px rgba(0, 0, 0, 0.8);
}

/* Book spine text */
.spine-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #00aeef;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        0 0 10px rgba(0, 174, 239, 0.8),
        0 0 20px rgba(0, 174, 239, 0.5);
}

/* Book top */
.book-top {
    position: absolute;
    left: -40px;
    top: -20px;
    width: 280px;
    height: 20px;
    background: linear-gradient(180deg, #3a4352 0%, #2a3342 100%);
    transform-origin: bottom center;
    transform: rotateX(90deg);
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Book shadow on card */
.book-card::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10px;
    right: 10px;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    filter: blur(10px);
    opacity: 0.6;
    transition: all 0.4s ease;
}

.book-item:hover .book-card::after {
    bottom: -20px;
    opacity: 0.8;
    transform: scaleX(1.1);
}

/* Glow effect on hover */
.book-item:hover .book-front {
    box-shadow: 
        0 0 0 1px rgba(0, 174, 239, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(0, 174, 239, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* Modern shelf platform */
.shelf-platform {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(180deg, rgba(0, 174, 239, 0.1) 0%, rgba(0, 174, 239, 0.05) 100%);
    border-radius: 2px;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Shelf edge accent */
.shelf-platform::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: #00aeef;
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.5);
    border-radius: 0 0 2px 2px;
}

/* Book title on hover */
.book-label {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 174, 239, 0.9);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    opacity: 1;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 174, 239, 0.3);
}

.book-item:hover .book-label {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 174, 239, 0.5);
    background: rgba(0, 174, 239, 1);
}

/* Loading state */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.loading-text {
    color: #00aeef;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: #00aeef;
    animation: loadingProgress 2s ease-out;
    box-shadow: 0 0 10px rgba(0, 174, 239, 0.5);
}

@keyframes loadingProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Glow effect for brand elements */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { filter: drop-shadow(0 0 10px rgba(0, 174, 239, 0.5)); }
    100% { filter: drop-shadow(0 0 20px rgba(0, 174, 239, 0.8)); }
}

/* Footer Styles */
.footer {
    background: linear-gradient(180deg, rgba(0, 174, 239, 0.1) 0%, rgba(26, 35, 50, 0.9) 100%);
    border-top: 2px solid #00aeef;
    box-shadow: 
        0 -10px 30px rgba(0, 0, 0, 0.3),
        0 -2px 20px rgba(0, 174, 239, 0.2);
    width: 100%;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    padding: 40px 20px;
    color: #8ea3b8;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.footer-content p {
    margin: 0;
}

/* Custom book spine colors */
.book-wrapper[data-title="RadNav"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("RadNav"))) .book-spine {
    background: linear-gradient(90deg, #1a4d7a 0%, #2a6da0 50%, #1a4d7a 100%);
}

.book-wrapper[data-title="PHIcure"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("PHIcure"))) .book-spine {
    background: linear-gradient(90deg, #4a7a1a 0%, #6aa02a 50%, #4a7a1a 100%);
}

.book-wrapper[data-title="ImaginePay"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImaginePay"))) .book-spine {
    background: linear-gradient(90deg, #7a4a1a 0%, #a06a2a 50%, #7a4a1a 100%);
}

.book-wrapper[data-title="ImagineHosting"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineHosting"))) .book-spine {
    background: linear-gradient(90deg, #7a1a4a 0%, #a02a6a 50%, #7a1a4a 100%);
}

.book-wrapper[data-title="ImagineReporting"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineReporting"))) .book-spine {
    background: linear-gradient(90deg, #4a1a7a 0%, #6a2aa0 50%, #4a1a7a 100%);
}

.book-wrapper[data-title="ImagineCo-Pilot"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineCo-Pilot"))) .book-spine {
    background: linear-gradient(90deg, #1a7a4a 0%, #2aa06a 50%, #1a7a4a 100%);
}

.book-wrapper[data-title="ImagineSoftware"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineSoftware"))) .book-spine {
    background: linear-gradient(90deg, #7a5a1a 0%, #a0802a 50%, #7a5a1a 100%);
}

.book-wrapper[data-title="ImagineMedMC"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineMedMC"))) .book-spine {
    background: linear-gradient(90deg, #5a1a7a 0%, #802aa0 50%, #5a1a7a 100%);
}

.book-wrapper[data-title="ImaginePeregrine"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImaginePeregrine"))) .book-spine {
    background: linear-gradient(90deg, #1a5a7a 0%, #2a80a0 50%, #1a5a7a 100%);
}

.book-wrapper[data-title="ImagineOne"] .book-spine,
.book-item:has(.book-3d:has(.spine-text:contains("ImagineOne"))) .book-spine {
    background: linear-gradient(90deg, #00aeef 0%, #0095d0 50%, #00aeef 100%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .books-container {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .site-header {
        position: sticky;
        top: 0;
    }

    .header-image {
        max-height: 120px;
    }

    .container {
        padding: 40px 15px;
    }

    h1 {
        font-size: 2em;
        letter-spacing: -1px;
    }
    
    .subtitle {
        font-size: 1em;
        margin-bottom: 40px;
    }

    .bookshelf-unit {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .shelf {
        margin-bottom: 40px;
        padding: 10px 0 30px;
    }
    
    .books-container {
        flex-direction: column;
        height: auto;
        gap: 40px;
        padding: 0 10px;
        align-items: center;
    }
    
    .book-item {
        width: 100%;
        max-width: 280px;
    }

    .book-3d {
        width: 100%;
        height: auto;
        aspect-ratio: 240/210;
    }

    .book-front {
        width: 100%;
        height: 100%;
    }

    .book-spine {
        display: none;
    }

    .book-top {
        display: none;
    }

    .book-item:hover {
        transform: scale(1.02);
    }

    .book-label {
        bottom: -35px;
        font-size: 0.85em;
        padding: 6px 16px;
        opacity: 1;
    }

    .book-item:hover .book-label {
        transform: translateX(-50%) scale(1.05);
    }

    .login-box {
        margin: 20px;
        padding: 40px 25px;
        max-width: calc(100% - 40px);
    }

    .login-logo h2 {
        font-size: 2em;
    }

    .form-input {
        padding: 12px 15px;
        font-size: 16px;
    }

    .footer-content {
        padding: 30px 15px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .bookshelf-unit {
        padding: 15px 10px;
    }

    .book-item {
        max-width: 240px;
    }

    .login-logo h2 {
        font-size: 1.75em;
    }

    .login-subtitle {
        font-size: 0.85em;
    }

    .error-message {
        font-size: 0.85em;
        padding: 10px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .books-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .book-item {
        width: 45%;
        max-width: 200px;
    }
}

@media (hover: none) {
    .book-label {
        opacity: 1;
    }

    .book-item {
        -webkit-tap-highlight-color: transparent;
    }
}