/* ====================================
   Base64 Encoder/Decoder - Complete Styling
   ==================================== */

/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #8b5cf6;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '🔐💻';
    position: absolute;
    font-size: 300px;
    opacity: 0.05;
    top: -50px;
    right: -50px;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: #f8f9fa;
}

/* Base64 Root */
.base64-root {
    max-width: 1200px;
    margin: 0 auto;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    padding: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.mode-btn {
    flex: 1;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.mode-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Tool Section */
.tool-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border: 2px solid rgba(139, 92, 246, 0.1);
}

/* Input Type Tabs */
.input-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #6b7280;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #8b5cf6;
    background: #f5f3ff;
}

.tab-btn.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
}

/* Encoder Container */
.encoder-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Input/Output Panels */
.input-panel,
.output-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.action-btn-small {
    padding: 6px 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn-small:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #f5f3ff;
}

/* Text Areas */
#inputText,
#outputText,
#fileOutputText {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #1f2937;
    color: #f3f4f6;
    transition: all 0.3s;
}

#inputText:focus,
#outputText:focus,
#fileOutputText:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

#inputText::placeholder,
#outputText::placeholder,
#fileOutputText::placeholder {
    color: #6b7280;
}

#outputText,
#fileOutputText {
    background: #111827;
    color: #10b981;
}

/* Input Info */
.input-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

/* Options Bar */
.options-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 20px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-mark {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-mark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.checkbox-label {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 17px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    background: white;
    border: 2px solid #e5e7eb;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

/* File Section */
.file-section {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* File Upload Area */
.file-upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: 15px;
    padding: 60px 30px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #f9fafb;
}

.file-upload-area:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
}

.file-upload-area.drag-over {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.file-upload-area h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.file-upload-area p {
    color: #6b7280;
    margin-bottom: 25px;
    font-size: 14px;
}

/* File Result */
.file-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* File Info Card */
.file-info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.file-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* File Output Panel */
.file-output-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#fileOutputText {
    min-height: 300px;
}

/* Examples Section */
.examples-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.examples-section h3 {
    color: #8b5cf6;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.example-card {
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.example-card:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.example-label {
    font-size: 12px;
    font-weight: 700;
    color: #8b5cf6;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.example-card code {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1f2937;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
    line-height: 1.4;
}

.example-arrow {
    text-align: center;
    font-size: 20px;
    color: #8b5cf6;
    margin: 10px 0;
    font-weight: 700;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid #3b82f6;
    padding: 30px;
    border-radius: 15px;
}

.info-box h4 {
    color: #1e40af;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 14px;
    color: #555;
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.info-item strong {
    color: #1e40af;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

/* SEO Content Section */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: #8b5cf6;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #8b5cf6;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-size: 15px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
}

.notification-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .encoder-container {
        grid-template-columns: 1fr;
    }
    
    #inputText,
    #outputText,
    #fileOutputText {
        min-height: 200px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
}

@media (max-width: 520px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 28px;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-separator {
        display: none;
    }
    
    .panel-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-btn-small {
        width: 100%;
    }
    
    .notification-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 14px;
    }
}

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