@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
    --yt-primary: #FF0000;
    --yt-primary-dark: #CC0000;
    --yt-primary-light: #FF3333;
    --yt-secondary: #065FD4;
    --yt-background: #FFFFFF;
    --yt-surface: #F9FAFB;
    --yt-border: #E5E7EB;
    --yt-text-primary: #111827;
    --yt-text-secondary: #6B7280;
    --yt-text-muted: #9CA3AF;
    --yt-success: #10B981;
    --yt-warning: #F59E0B;
    --yt-gradient: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    --yt-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --yt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --yt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --yt-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.yt-watch-time-calculator {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.yt-watch-time-calculator * {
    box-sizing: border-box;
}

.yt-calc-container {
    background: var(--yt-background);
    border-radius: 24px;
    box-shadow: var(--yt-shadow-xl);
    overflow: hidden;
    border: 1px solid var(--yt-border);
    position: relative;
}

.yt-calc-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--yt-gradient);
}

.yt-calc-header {
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
    padding: 40px 32px 32px;
    text-align: center;
    position: relative;
}

.yt-header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--yt-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
    transform: rotate(-3deg);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: rotate(-3deg) translateY(0px); }
    50% { transform: rotate(-3deg) translateY(-8px); }
}

.yt-header-icon svg {
    width: 36px;
    height: 36px;
}

.yt-calc-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--yt-text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.yt-calc-body {
    padding: 40px 32px;
}

.yt-input-group {
    margin-bottom: 28px;
}

.yt-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.label-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--yt-text-primary);
    letter-spacing: -0.2px;
}

.label-helper {
    font-size: 13px;
    color: var(--yt-text-secondary);
    font-weight: 400;
}

.yt-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.yt-input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 90px;
    font-size: 16px;
    border: 2px solid var(--yt-border);
    border-radius: 12px;
    background: var(--yt-surface);
    color: var(--yt-text-primary);
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

.yt-input:hover {
    border-color: #D1D5DB;
    background: #FFFFFF;
}

.yt-input:focus {
    outline: none;
    border-color: var(--yt-primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.1);
}

.input-suffix {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--yt-text-muted);
    pointer-events: none;
}

.yt-calc-button {
    width: 100%;
    padding: 16px 24px;
    background: var(--yt-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.yt-calc-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.yt-calc-button:hover::before {
    width: 300px;
    height: 300px;
}

.yt-calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.4);
}

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

.button-text {
    position: relative;
    z-index: 1;
}

.button-icon {
    position: relative;
    z-index: 1;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.yt-calc-button:hover .button-icon {
    transform: translateX(4px);
}

.yt-results {
    padding: 32px;
    background: linear-gradient(135deg, #FAFAFA 0%, #F9FAFB 100%);
    border-top: 1px solid var(--yt-border);
    animation: slideDown 0.4s ease-out;
}

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

.yt-results-header h3 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--yt-text-primary);
    margin: 0 0 24px 0;
    text-align: center;
}

.yt-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.yt-result-card {
    background: white;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    border: 1px solid var(--yt-border);
    box-shadow: var(--yt-shadow-sm);
    transition: all 0.3s ease;
    animation: cardPop 0.5s ease-out backwards;
}

.yt-result-card:nth-child(1) { animation-delay: 0.1s; }
.yt-result-card:nth-child(2) { animation-delay: 0.2s; }
.yt-result-card:nth-child(3) { animation-delay: 0.3s; }
.yt-result-card:nth-child(4) { animation-delay: 0.4s; }

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

.yt-result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--yt-shadow-lg);
}

.result-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--yt-text-primary);
    font-family: 'Bricolage Grotesque', sans-serif;
    line-height: 1.2;
    margin-bottom: 4px;
}

.result-label {
    font-size: 13px;
    color: var(--yt-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.milestone-card {
    grid-column: span 2;
}

.milestone-card .result-value {
    font-size: 20px;
}

.result-detail {
    margin-top: 8px;
    font-size: 13px;
    color: var(--yt-text-secondary);
    line-height: 1.4;
}

.yt-progress-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--yt-border);
    animation: cardPop 0.5s ease-out 0.5s backwards;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--yt-text-primary);
}

.progress-percentage {
    color: var(--yt-primary);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 16px;
}

.progress-bar {
    height: 12px;
    background: #E5E7EB;
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--yt-gradient);
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-footer {
    margin-top: 8px;
    font-size: 13px;
    color: var(--yt-text-secondary);
    text-align: center;
}

@media (max-width: 640px) {
    .yt-watch-time-calculator {
        padding: 12px;
    }
    
    .yt-calc-header {
        padding: 32px 24px 24px;
    }
    
    .yt-calc-title {
        font-size: 24px;
    }
    
    .yt-calc-body,
    .yt-results {
        padding: 24px 20px;
    }
    
    .yt-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .milestone-card {
        grid-column: span 2;
    }
}
