/**
 * Base64 Encoder/Decoder Styles - Improved Version
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Main Container */
.base64-encoder-decoder-container {
    font-family: 'Poppins', sans-serif;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header - Now part of the main container with gradient */
.base64-header {
    text-align: center;
    background: linear-gradient(60deg, #7928CA, #FF0080);
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
    color: white;
    margin-bottom: 0;
    position: relative;
    z-index: 5; /* Ensure header is above other elements */
}

.base64-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    z-index: 10; /* Ensure title is above other elements */
}

.base64-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 10; /* Ensure subtitle is above other elements */
}

/* Main Tool Container - Reduced height */
.base64-tool {
    position: relative;
    background: var(--bg-color, white);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: var(--text-color, #333);
    z-index: 1; /* Lower z-index than header */
}

/* Tabs */
.base64-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    position: relative;
    z-index: 1; /* Lower z-index than header */
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--tab-bg, #f8fafc);
    color: var(--tab-text, #64748b);
    position: relative;
    z-index: 1; /* Lower z-index than header */
}

.tab:hover:not(.tab-active) {
    background: rgba(121, 40, 202, 0.1);
}

.tab-active {
    background: linear-gradient(90deg, #7928CA, #FF0080);
    color: white;
}

/* Input/Output Sections - Reduced height */
.base64-section {
    margin-bottom: 1rem;
}

.base64-label {
    display: block;
    color: var(--label-color, #4b5563);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.textarea-container {
    position: relative;
    height: 120px; /* Reduced height */
}

.base64-textarea {
    width: 100%;
    height: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 0.5rem;
    resize: none;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background-color: var(--textarea-bg, white);
    color: var(--text-color, #333);
}

.base64-textarea:focus {
    outline: none;
    border-color: #7928CA;
    box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.2);
}

.base64-output {
    background-color: var(--output-bg, #f8fafc);
}

/* Action Buttons - Consistent styling for all buttons */
.base64-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: white;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(90deg, #7928CA, #FF0080);
    box-shadow: 0 4px 6px rgba(121, 40, 202, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(121, 40, 202, 0.3);
}

.btn-secondary {
    background: linear-gradient(90deg, #00BFFF, #0099cc);
    box-shadow: 0 4px 6px rgba(0, 191, 255, 0.25);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 191, 255, 0.3);
}

.base64-icon {
    width: 20px;
    height: 20px;
    color: white;
}

/* Options Section - Improved visibility */
.base64-options {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--options-bg, #f8fafc);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e2e8f0);
}

/* Highly visible options title in both modes */
.options-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #164b7f; /* Pink color that works in both light and dark modes */
    background: var(--options-title-bg, rgba(255, 0, 128, 0.1));
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    display: inline-block;
    margin-left: -0.5rem;
    border-left: 3px solid #ffffff;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
}

.option-checkbox {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    accent-color: #7928CA;
}

.option-label {
    color: var(--label-color, #4b5563);
    font-size: 0.95rem;
}

/* Success Animation */
.success-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-animation-container.show {
    opacity: 1;
}

.success-circle {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-animation-container.show .success-circle {
    transform: scale(1);
}

.success-checkmark {
    width: 30px;
    height: 60px;
    border-right: 6px solid white;
    border-bottom: 6px solid white;
    transform: rotate(45deg) translate(-5px, -10px) scale(0);
    transition: transform 0.3s ease 0.2s;
}

.success-animation-container.show .success-checkmark {
    transform: rotate(45deg) translate(-5px, -10px) scale(1);
}

/* Notification */
#base64-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    opacity: 1;
    transition: all 0.5s ease;
    z-index: 1000;
}

.notification-hidden {
    transform: translateY(-20px) !important;
    opacity: 0 !important;
}

#base64-notification.error {
    background-color: #ef4444;
}

/* Footer - Now properly connected to the main container */
.base64-footer {
    text-align: center;
    padding: 0.75rem;
    color: var(--footer-text, #94a3b8);
    font-size: 0.9rem;
    background-color: var(--footer-bg, #f8fafc);
    border-radius: 0 0 1rem 1rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 20; /* Higher z-index to stay on top */
}

.theme-toggle .base64-icon {
    width: 24px;
    height: 24px;
    color: white;
}

/* Dark Mode - Improved contrast for better visibility */
.dark-mode {
    --bg-color: #1e293b;
    --text-color: #e2e8f0;
    --border-color: #475569;
    --label-color: #e2e8f0;
    --title-color: #ffffff;
    --textarea-bg: #0f172a;
    --output-bg: #1e293b;
    --tab-bg: #334155;
    --tab-text: #e2e8f0;
    --options-bg: #334155;
    --options-title-bg: rgba(255, 0, 128, 0.2); /* Slightly darker background in dark mode */
    --btn-bg: #475569;
    --btn-hover: #7928CA;
    --icon-color: #e2e8f0;
    --footer-bg: #1e293b;
    --footer-text: #cbd5e1;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1s;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(121, 40, 202, 0.5); }
    50% { box-shadow: 0 0 20px rgba(121, 40, 202, 0.8); }
    100% { box-shadow: 0 0 5px rgba(121, 40, 202, 0.5); }
}

.glow {
    animation: glow 1s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .base64-title {
        font-size: 1.75rem;
    }
    
    .base64-tool {
        padding: 1rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .action-btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .base64-title {
        font-size: 1.5rem;
    }
    
    .base64-subtitle {
        font-size: 0.9rem;
    }
    
    .base64-tool {
        padding: 0.75rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .textarea-container {
        height: 100px;
    }
    
    /* Icons-only on mobile for buttons */
    .action-btn {
        min-width: 0;
        flex: 1;
        padding: 0.75rem;
    }
    
    .btn-text {
        display: none;
    }
    
    .base64-icon {
        margin: 0 auto;
    }
}