/* ============================================
   KMD Hardfork Countdown - Styles
   ============================================ */

/* CSS Variables for easy customization */
:root {
    --primary-dark: #0a0e17;
    --secondary-dark: #0d1421;
    --accent-primary: #00d4aa;
    --accent-secondary: #0099ff;
    --accent-gradient: linear-gradient(135deg, #00d4aa 0%, #0099ff 100%);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(0, 212, 170, 0.3);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Global Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

code {
    background: rgba(0, 212, 170, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* ============================================
   Background Animation
   ============================================ */

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(10, 14, 23, 1) 0%,
        rgba(13, 20, 33, 0.5) 25%,
        rgba(10, 14, 23, 0.8) 50%,
        rgba(13, 20, 33, 0.5) 75%,
        rgba(10, 14, 23, 1) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.content {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ============================================
   Header Section
   ============================================ */

.header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
}

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

/* ============================================
   Countdown Section
   ============================================ */

.countdown-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Flip Card Animation */
.flip-card {
    width: clamp(70px, 15vw, 120px);
    height: clamp(80px, 18vw, 140px);
    perspective: 1000px;
    position: relative;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipping .flip-card-inner {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(-90deg); }
    100% { transform: rotateX(0deg); }
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 212, 170, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.flip-card-front::before,
.flip-card-back::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.flip-card-front::after,
.flip-card-back::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.flip-card-back {
    transform: rotateX(180deg);
}

.number {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.separator {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--accent-primary);
    padding: 0 0.25rem;
    margin-bottom: 2rem;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   Countdown Info
   ============================================ */

.countdown-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 900px;
}

.info-item {
    background: rgba(26, 42, 74, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.info-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.3);
    transform: translateY(-5px);
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.info-value {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Event Date Display
   ============================================ */

.event-date {
    text-align: center;
    padding: 20px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
}

.event-date p {
    margin: 8px 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.event-date span {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.date-note {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
    margin-top: 10px !important;
}

/* ============================================
   Description Section
   ============================================ */

.description {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.description-content {
    background: rgba(26, 42, 74, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
}

.description-content h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.description-block {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 212, 170, 0.2);
}

.description-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.description-block h3 {
    font-size: 1.2rem;
    color: var(--accent-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.description-block p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.description-block a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.description-block a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

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

/* ============================================
   Status Section
   ============================================ */

.status-section {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 25px;
    background: rgba(26, 42, 74, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.error {
    background-color: #ff4444;
    animation: statusPulseError 1s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 212, 170, 0);
    }
}

@keyframes statusPulseError {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 68, 68, 0);
    }
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.footer p {
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-note {
    font-style: italic;
    opacity: 0.8;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .content {
        gap: 30px;
    }

    .description-content {
        padding: 20px;
    }

    .countdown-container {
        gap: 0.25rem;
    }

    .separator {
        padding: 0 0.125rem;
        margin-bottom: 1.5rem;
    }

    .countdown-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-item {
        padding: 15px;
    }

    .description-block {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .title {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .content {
        gap: 25px;
    }

    .flip-card {
        width: 60px;
        height: 70px;
    }

    .number {
        font-size: 1.75rem;
    }

    .separator {
        font-size: 1.5rem;
    }

    .label {
        font-size: 0.7rem;
    }

    .countdown-info {
        grid-template-columns: 1fr;
    }

    .info-item {
        padding: 15px;
    }

    .description-content {
        padding: 15px;
    }

    .description-content h2 {
        font-size: 1.3rem;
    }

    .description-block h3 {
        font-size: 1rem;
    }

    .description-block p {
        font-size: 0.9rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--primary-dark);
}
