/* Modern Premium Design System */
:root {
    --primary-dark: #1a1a2e;
    --primary-accent: #0f3460;
    --secondary-accent: #16213e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(15, 52, 96, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(44, 83, 100, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(32, 58, 67, 0.4) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: breathe 20s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header */
.header-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 48px;
}

.logo {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

/* Main Title */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin: 32px 0 56px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 2px;
}

/* Platform Grid */
.platforms {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin: 0 auto;
    max-width: 1200px;
}

.platform-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
}

.platform-row:has(.platform-item:only-child) {
    grid-template-columns: minmax(320px, 500px);
}

.platform-item {
    position: relative;
    text-align: center;
}

.platform-item h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Platform Cards */
.platform-item a {
    display: block;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.platform-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.platform-item a::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.platform-item a:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-color: rgba(255, 255, 255, 0.3);
}

.platform-item a:hover::before {
    opacity: 1;
}

.platform-item a:hover::after {
    opacity: 1;
}

.platform-item a:active {
    transform: translateY(-8px) scale(1.01);
}

.platform-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.platform-item a:hover .platform-image {
    transform: scale(1.05);
}

/* Token Button */
.token-button {
    display: inline-block;
    margin: 24px 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.token-image {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.4));
    transition: var(--transition);
}

.token-button:hover .token-image {
    transform: scale(1.1) rotate(10deg);
    filter: drop-shadow(0 8px 24px rgba(255, 215, 0, 0.6));
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 32px 24px;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sensei-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 16px;
}

.sensei-link:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.copyright {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.legal-notice {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Modals */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.3s ease-out;
}

.custom-modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(15, 52, 96, 0.98) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 48px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    position: relative;
    max-width: 500px;
    width: 100%;
    color: var(--text-primary);
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-content h1,
.modal-content h2 {
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-content h1 {
    font-size: 1.75rem;
}

.modal-content h2 {
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
}

.close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Modal Images */
.modal-logo {
    max-width: 200px;
    height: auto;
    margin: 0 auto 32px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.pdf-icon,
.att-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: block;
    opacity: 0.9;
}

/* Modal Links */
.modal-content a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content a:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Download Options */
.download-options {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 32px 0;
}

.manual-download,
.files-download {
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.manual-download:hover,
.files-download:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Close Button */
.close-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 24px;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Pin Modal Specific */
#pin-modal .modal-content {
    max-width: 400px;
}

#pin-input {
    width: 140px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    padding: 16px;
    margin: 24px auto;
    display: block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
}

#pin-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

#pin-submit {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
    padding: 12px 40px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
}

#pin-submit:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Buttons */
button,
.btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

button:hover,
.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Form Elements */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .platform-row {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
        margin: 24px 0 40px;
    }
    
    .container {
        padding: 24px 16px;
    }
    
    .modal-content {
        padding: 24px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Staggered fade-in animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation for PIN errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake-error {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-item {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.platform-row:nth-child(1) .platform-item:nth-child(1) { animation-delay: 0.1s; }
.platform-row:nth-child(1) .platform-item:nth-child(2) { animation-delay: 0.2s; }
.platform-row:nth-child(2) .platform-item:nth-child(1) { animation-delay: 0.3s; }
.platform-row:nth-child(2) .platform-item:nth-child(2) { animation-delay: 0.4s; }
.platform-row:nth-child(3) .platform-item:nth-child(1) { animation-delay: 0.5s; }

.header-container {
    animation: fadeIn 0.8s ease-out 0s backwards;
}

.token-button {
    animation: fadeIn 0.8s ease-out 0.35s backwards;
}
