/* ============================================
   BASE64-TOOLS.HTML - SAYFA ÖZEL STİLLER
   Base64 Encoder/Decoder
   ============================================ */

/* 1. PAGE BODY CLASS */
.page-base64-tools {
    /* Sayfa özel stiller varsa buraya */
}

/* 2. MAIN LAYOUT */
.main-content-no-padding {
    padding-top: 0 !important;
}

/* 3. MAIN GRID */
.base64-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

/* 4. EDITOR CARD */
.editor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    margin-bottom: 24px;
}

.editor-card:last-child {
    margin-bottom: 0;
}

.editor-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(38, 188, 194, 0.2);
}

/* 5. CARD HEADER */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(38, 188, 194, 0.08), rgba(14, 165, 233, 0.08));
    border-bottom: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    margin: -30px -30px 24px -30px;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    color: var(--primary);
    font-size: 1.3rem;
}

.panel-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* 6. MODE TABS */
.mode-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mode-tab {
    flex: 1;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-tab i {
    font-size: 1rem;
}

.mode-tab:hover {
    background: var(--surface);
    color: var(--text-main);
}

.mode-tab.active {
    background: var(--primary);
    color: #fff;
}

/* 7. MODE CONTENT */
.mode-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 8. BASE64 TEXTAREA */
.base64-textarea {
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    padding: 16px;
    font-size: 0.9rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background-color: #fff;
    color: var(--text-main);
    transition: all 0.2s;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    line-height: 1.6;
    resize: vertical;
}

.base64-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 188, 194, 0.1);
}

.base64-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.base64-textarea[readonly] {
    cursor: default;
    background: #f8fafc;
}

/* 9. OUTPUT STATS */
.output-stats {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(38, 188, 194, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* 10. FILE UPLOAD AREA */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 32px;
    background: #f8fafc;
    border: 2px dashed var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    background: rgba(38, 188, 194, 0.1);
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(38, 188, 194, 0.1);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.file-upload-area:hover .upload-icon,
.file-upload-area.drag-over .upload-icon {
    color: var(--primary);
    transform: scale(1.1);
    opacity: 1;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.upload-hint {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a6e6e9 0%, #8cd8dc 100%);
    color: #00445e;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(38, 188, 194, 0.25);
}

.upload-btn:hover {
    background: linear-gradient(135deg, #8cd8dc 0%, #6cc9cf 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(38, 188, 194, 0.35);
}

.upload-info {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 11. FILE INFO */
.file-info {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(38, 188, 194, 0.08);
    border: 2px solid rgba(38, 188, 194, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}

.file-info.show {
    display: flex;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.file-details i {
    font-size: 1.5rem;
    color: var(--primary);
}

.file-details div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-details strong {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.file-details span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.remove-file-btn {
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #dc2626;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-file-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* 12. IMAGE PREVIEW */
.image-preview-container {
    min-height: 250px;
    padding: 24px;
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.preview-info {
    padding: 10px 16px;
    background: rgba(38, 188, 194, 0.08);
    border: 2px solid rgba(38, 188, 194, 0.3);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 13. ACTION BUTTONS */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-buttons.show {
    display: flex;
}

.page-base64-tools .action-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.page-base64-tools .action-btn i {
    font-size: 1rem;
}

.page-base64-tools .action-btn.encode {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.page-base64-tools .action-btn.encode:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
}

.page-base64-tools .action-btn.decode {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

.page-base64-tools .action-btn.decode:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.page-base64-tools .action-btn.copy {
    background: rgba(38, 188, 194, 0.1);
    border-color: rgba(38, 188, 194, 0.3);
    color: var(--primary);
}

.page-base64-tools .action-btn.copy:hover {
    background: rgba(38, 188, 194, 0.2);
    transform: translateY(-2px);
}

.page-base64-tools .action-btn.download {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #9333ea;
}

.page-base64-tools .action-btn.download:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.page-base64-tools .action-btn.clear {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-main);
}

.page-base64-tools .action-btn.clear:hover {
    background: var(--bg-body);
    transform: translateY(-2px);
}

/* 14. INFO ALERT */
.info-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(38, 188, 194, 0.08);
    border: 2px solid rgba(38, 188, 194, 0.3);
    border-radius: 8px;
    margin-top: 24px;
}

.info-alert i {
    color: var(--primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-alert div {
    flex: 1;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-alert strong {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   15. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    /* Main Grid */
    .base64-main-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    /* Editor Card */
    .editor-card {
        padding: 20px;
    }

    /* Card Header */
    .card-header {
        margin: -20px -20px 20px -20px;
        padding: 16px 20px;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }

    /* Mode Tabs */
    .mode-tabs {
        gap: 4px;
    }

    .mode-tab {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .mode-tab i {
        font-size: 0.9rem;
    }

    /* Textarea */
    .base64-textarea {
        min-height: 350px;
        font-size: 0.85rem;
    }
    
    /* Samples */
    .sample-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* File Upload */
    .file-upload-area {
        min-height: 200px;
        padding: 24px 16px;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .upload-text {
        font-size: 1rem;
    }

    /* File Details */
    .file-details {
        gap: 10px;
    }

    .file-details i {
        font-size: 1.25rem;
    }

    /* Image Preview */
    .image-preview-container {
        min-height: 250px;
        padding: 16px;
    }

    .image-preview-container img {
        max-height: 300px;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
    }

    .page-base64-tools .primary-btn,
    .page-base64-tools .secondary-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Editor Card */
    .editor-card {
        padding: 16px;
    }

    /* Card Header */
    .card-header {
        margin: -16px -16px 16px -16px;
        padding: 14px 16px;
    }
    
    .card-header h2 {
        font-size: 0.95rem;
    }

    /* Mode Tabs */
    .mode-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .mode-tab {
        width: 100%;
    }

    /* Textarea */
    .base64-textarea {
        min-height: 300px;
        padding: 12px;
        font-size: 0.8rem;
    }
    
    /* Samples */
    .sample-buttons {
        grid-template-columns: 1fr;
    }

    /* File Upload */
    .file-upload-area {
        min-height: 180px;
        padding: 16px;
    }

    .upload-icon {
        font-size: 2rem;
    }

    .upload-text {
        font-size: 0.95rem;
    }

    .upload-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* File Info */
    .file-info {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .remove-file-btn {
        align-self: flex-end;
    }

    /* Image Preview */
    .image-preview-container {
        min-height: 200px;
        padding: 12px;
    }

    .image-preview-container img {
        max-height: 250px;
    }

    /* Buttons */
    .page-base64-tools .primary-btn,
    .page-base64-tools .secondary-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* ============================================
   16. DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .page-base64-tools {
        /* Dark mode değişkenleri gerekirse buraya */
    }

    .editor-card {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .mode-tab {
        color: rgba(255, 255, 255, 0.6);
    }

    .mode-tab:hover {
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
    }

    .mode-tab.active {
        background: var(--primary);
        color: #fff;
    }

    .base64-textarea {
        background-color: rgba(15, 23, 42, 0.8);
        color: #f1f5f9;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .base64-textarea::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

    .base64-textarea[readonly] {
        background: rgba(15, 23, 42, 0.6);
    }

    .file-upload-area {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .file-upload-area:hover,
    .file-upload-area.drag-over {
        background: rgba(38, 188, 194, 0.1);
    }

    .file-info {
        background: rgba(38, 188, 194, 0.1);
        border-color: rgba(38, 188, 194, 0.3);
    }

    .image-preview-container {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .preview-info {
        background: rgba(38, 188, 194, 0.1);
        border-color: rgba(38, 188, 194, 0.3);
    }

    .output-stats {
        background: rgba(38, 188, 194, 0.1);
    }

    .info-alert {
        background: rgba(38, 188, 194, 0.1);
        border-color: rgba(38, 188, 194, 0.3);
    }
    
    .samples-section,
    .tool-card {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .sample-btn {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .sample-btn:hover {
        background: rgba(30, 41, 59, 0.9);
    }
}

/* ============================================
   17. SCROLLBAR STYLING
   ============================================ */

.base64-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.base64-textarea::-webkit-scrollbar-track {
    background: rgba(100, 116, 139, 0.1);
    border-radius: 4px;
}

.base64-textarea::-webkit-scrollbar-thumb {
    background: rgba(38, 188, 194, 0.3);
    border-radius: 4px;
}

.base64-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(38, 188, 194, 0.5);
}

/* ============================================
   18. SAMPLES SECTION
   ============================================ */

.samples-section {
    margin: 40px 0;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.samples-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.samples-section h3 i {
    color: var(--primary);
}

.sample-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.sample-btn {
    padding: 14px 16px;
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sample-btn i {
    color: var(--primary);
    font-size: 1.1rem;
}

.sample-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ============================================
   19. ADVANCED TOOLS
   ============================================ */

.advanced-tools {
    margin: 60px 0 40px;
}

.tools-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tools-title i {
    color: var(--primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.tool-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tool-header i {
    font-size: 1.3rem;
    color: var(--primary);
}

.tool-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.tool-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.tool-btn {
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.08);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: #4f46e5;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   20. PRINT STYLES
   ============================================ */

@media print {
    .mode-tabs,
    .action-buttons,
    .file-upload-area,
    .file-info,
    .info-alert,
    .remove-file-btn,
    .upload-btn,
    .samples-section,
    .advanced-tools {
        display: none;
    }

    .base64-textarea,
    .image-preview-container {
        border: 1px solid #000;
        min-height: auto;
    }

    .image-preview-container img {
        max-height: none;
        page-break-inside: avoid;
    }
}
