/* Custom styles for File Size Converter */
* {
    box-sizing: border-box;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background-color: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main {
    flex: 1 0 auto;
    padding: 20px 0;
}

.brand-logo {
    font-size: 1.3rem !important;
    font-weight: 500;
}

.brand-logo i {
    font-size: 2rem;
}

.card {
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.card .card-title {
    font-weight: 600;
    margin-bottom: 20px;
    color: #1565C0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.striped tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.btn-flat {
    width: 100%;
    text-align: center;
    margin: 5px 0;
    border-radius: 8px;
    padding: 12px 8px;
    background-color: #f0f2f5;
    transition: all 0.3s ease;
    color: #1565C0;
    font-weight: 500;
    font-size: 0.85rem;
    word-break: break-word;
}

.btn-flat:hover {
    background-color: #e3e6ea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.collapsible-header {
    font-weight: 500;
    padding: 16px 20px;
}

.collapsible-header i {
    margin-right: 15px;
}

#result-text, #conv-result-text {
    font-weight: 700;
    color: #1b5e20;
    font-size: 1.8rem;
    word-break: break-word;
}

#result-detail, #conv-result-detail {
    font-size: 0.95rem;
    opacity: 0.8;
}

.green.lighten-4 {
    border-radius: 12px;
    background-color: #e8f5e9 !important;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #90a4ae;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    position: relative;
}

.file-upload-area:hover {
    border-color: #1565C0;
    background-color: #e3f2fd;
}

.file-upload-area.dragover {
    border-color: #1565C0;
    background-color: #e3f2fd;
    transform: scale(1.01);
}

.file-upload-content i {
    font-size: 64px;
    color: #90a4ae;
    margin-bottom: 10px;
}

.file-upload-badge {
    display: inline-block;
    margin-top: 15px;
    padding: 6px 16px;
    background-color: #e8f5e9;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #2e7d32;
}

.file-upload-badge i {
    font-size: 14px;
    vertical-align: middle;
}

/* Chips */
.chip {
    display: inline-block;
    margin: 4px;
    padding: 8px 14px;
    border-radius: 20px;
    background-color: #e3f2fd;
    font-size: 0.8rem;
    color: #1565C0;
    word-break: break-word;
}

.chip.blue-text {
    background-color: #e3f2fd;
}

/* History */
.collection .collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 20px;
}

@media only screen and (max-width: 600px) {
    .brand-logo {
        font-size: 0.85rem !important;
        max-width: 55%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .brand-logo i {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.6rem !important;
    }
    
    .flow-text {
        font-size: 0.95rem !important;
    }
    
    .card-title {
        font-size: 1.1rem !important;
    }
    
    #result-text, #conv-result-text {
        font-size: 1.2rem !important;
    }
    
    .btn-flat {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .input-field {
        margin-bottom: 8px;
    }
    
    .table-responsive table {
        font-size: 0.7rem;
    }
    
    .table-responsive table th,
    .table-responsive table td {
        padding: 6px 4px;
    }
    
    .file-upload-area {
        padding: 20px 10px;
    }
    
    .file-upload-content i {
        font-size: 40px;
    }
    
    .collection .collection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .collection .collection-item .right {
        float: none;
        font-size: 0.75rem;
    }
}

@media only screen and (max-width: 400px) {
    .brand-logo {
        font-size: 0.7rem !important;
        max-width: 45%;
    }
    
    h1 {
        font-size: 1.3rem !important;
    }
    
    .btn-floating {
        width: 36px;
        height: 36px;
    }
    
    .btn-floating i {
        line-height: 36px;
        font-size: 1.2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#result-area, #conv-result, #file-info {
    animation: fadeIn 0.3s ease;
}

/* Print styles */
@media print {
    .sidenav-trigger, .adsbygoogle, .btn, .btn-floating {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a2e;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #16213e;
        color: #e0e0e0;
    }
    
    .card .card-title {
        color: #64B5F6;
    }
    
    .card-panel {
        background-color: #1a2a1a !important;
    }
    
    table.striped tbody tr:nth-child(odd) {
        background-color: #1a1a3e;
    }
    
    .btn-flat {
        background-color: #2a2a4e;
        color: #64B5F6;
    }
    
    .btn-flat:hover {
        background-color: #3a3a5e;
    }
    
    .green.lighten-4 {
        background-color: #1a3a2a !important;
    }
    
    #result-text, #conv-result-text {
        color: #66BB6A;
    }
    
    .grey-text {
        color: #b0b0b0 !important;
    }
    
    .blue-text {
        color: #64B5F6 !important;
    }
    
    .file-upload-area {
        border-color: #4a4a6e;
        background-color: #1a1a3e;
    }
    
    .file-upload-area:hover {
        border-color: #64B5F6;
        background-color: #1a2a4e;
    }
    
    .chip {
        background-color: #2a2a4e;
        color: #64B5F6;
    }
    
    .chip.blue-text {
        background-color: #2a2a4e;
    }
    
    .collection .collection-item {
        background-color: #16213e;
        border-color: #2a2a4e;
    }
    
    .file-upload-badge {
        background-color: #1a3a2a;
        color: #66BB6A;
    }
    
    input, select {
        color: #e0e0e0 !important;
        border-bottom-color: #4a4a6e !important;
    }
    
    input:focus, select:focus {
        border-bottom-color: #64B5F6 !important;
        box-shadow: 0 1px 0 0 #64B5F6 !important;
    }
    
    label {
        color: #9e9e9e !important;
    }
    
    input:focus + label {
        color: #64B5F6 !important;
    }
}

/* Toast notifications */
.toast {
    border-radius: 8px !important;
}

/* Select dropdown fix */
.select-wrapper input.select-dropdown {
    color: #333;
}

@media (prefers-color-scheme: dark) {
    .select-wrapper input.select-dropdown {
        color: #e0e0e0;
    }
}