/**
 * Base64 Encode Decode Tool - Styles
 * Modern glassmorphism UI
 */

:root {
    --b64-primary: #6366f1;
    --b64-primary-dark: #4f46e5;
    --b64-secondary: #ec4899;
    --b64-bg-dark: #0f172a;
    --b64-bg-card: rgba(30, 41, 59, 0.7);
    --b64-text: #f8fafc;
    --b64-text-muted: #94a3b8;
    --b64-border: rgba(148, 163, 184, 0.2);
    --b64-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --b64-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    --b64-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.base64-tool-container {
    max-width: 700px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.base64-tool-card {
    background: var(--b64-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--b64-border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--b64-shadow), var(--b64-glow);
    position: relative;
    overflow: hidden;
}

.base64-tool-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: b64-float 8s ease-in-out infinite;
}

@keyframes b64-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.base64-tool-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.base64-tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--b64-primary) 0%, var(--b64-secondary) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.5);
    animation: b64-pulse 2s ease-in-out infinite;
}

@keyframes b64-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 25px 50px -10px rgba(99, 102, 241, 0.7); }
}

.base64-tool-icon svg {
    width: 40px;
    height: 40px;
    color: white;
    stroke-width: 2.5;
}

.base64-tool-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--b64-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--b64-text) 0%, var(--b64-primary-light, #a5b4fc) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.base64-tool-subtitle {
    color: var(--b64-text-muted);
    font-size: 1rem;
    font-weight: 400;
}

.base64-tool-form {
    position: relative;
    z-index: 1;
}

.base64-tool-label {
    display: block;
    color: var(--b64-text);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.base64-tool-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--b64-border);
    border-radius: 16px;
    color: var(--b64-text);
    font-size: 1rem;
    font-family: 'SF Mono', Monaco, monospace;
    line-height: 1.6;
    resize: vertical;
    transition: var(--b64-transition);
    outline: none;
}

.base64-tool-textarea:focus {
    border-color: var(--b64-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.base64-tool-textarea::placeholder {
    color: var(--b64-text-muted);
}

.base64-tool-input-section {
    margin-bottom: 1.5rem;
}

.base64-tool-options {
    margin-bottom: 1.5rem;
}

.base64-tool-radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.base64-tool-radio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.base64-tool-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.base64-tool-radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--b64-border);
    border-radius: 50%;
    position: relative;
    transition: var(--b64-transition);
    background: rgba(15, 23, 42, 0.4);
}

.base64-tool-radio input:checked + .base64-tool-radio-custom {
    border-color: var(--b64-primary);
    background: var(--b64-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.base64-tool-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.base64-tool-radio input:checked + .base64-tool-radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.base64-tool-radio-label {
    color: var(--b64-text);
    font-weight: 500;
    font-size: 1rem;
}

.base64-tool-radio:hover .base64-tool-radio-custom {
    border-color: var(--b64-primary);
}

.base64-tool-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--b64-primary) 0%, var(--b64-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--b64-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.base64-tool-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.base64-tool-btn:hover::before {
    left: 100%;
}

.base64-tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.6);
}

.base64-tool-btn:active {
    transform: translateY(-1px);
}

.base64-tool-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.base64-tool-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: b64-spin 0.8s linear infinite;
}

.base64-tool-btn.loading .base64-tool-btn-text {
    display: none;
}

.base64-tool-btn.loading .base64-tool-spinner {
    display: block;
}

@keyframes b64-spin {
    to { transform: rotate(360deg); }
}

.base64-tool-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecaca;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-top: 1rem;
    display: none;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    animation: b64-shake 0.5s ease;
}

.base64-tool-error.show {
    display: block;
}

@keyframes b64-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.base64-tool-output-section {
    margin-top: 1.5rem;
    display: none;
    position: relative;
    z-index: 1;
    animation: b64-slideUp 0.4s ease;
}

.base64-tool-output-section.show {
    display: block;
}

@keyframes b64-slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.base64-tool-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.base64-tool-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: #34d399;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--b64-transition);
}

.base64-tool-copy-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.base64-tool-copy-btn svg {
    width: 16px;
    height: 16px;
}

.base64-tool-copy-btn.copied {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.base64-tool-output {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.base64-tool-output:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .base64-tool-container {
        margin: 1rem;
    }
    
    .base64-tool-card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .base64-tool-icon {
        width: 60px;
        height: 60px;
    }
    
    .base64-tool-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .base64-tool-title {
        font-size: 1.5rem;
    }
    
    .base64-tool-radio-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .base64-tool-output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .base64-tool-copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Light mode support */
@media (prefers-color-scheme: light) {
    :root {
        --b64-bg-dark: #f8fafc;
        --b64-bg-card: rgba(255, 255, 255, 0.9);
        --b64-text: #0f172a;
        --b64-text-muted: #64748b;
        --b64-border: rgba(148, 163, 184, 0.3);
        --b64-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    }
    
    .base64-tool-textarea {
        background: rgba(241, 245, 249, 0.8);
        color: var(--b64-text);
    }
    
    .base64-tool-radio-custom {
        background: rgba(241, 245, 249, 0.8);
    }
    
    .base64-tool-output {
        background: rgba(16, 185, 129, 0.05);
    }
    
    .base64-tool-error {
        background: rgba(239, 68, 68, 0.05);
        color: #dc2626;
    }
}