/* 
 * Responsive Design Framework for Mobile & Desktop
 * Breakpoints: 320px (mobile), 768px (tablet), 1024px (desktop)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Container Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
    .grid {
        gap: 15px;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .grid {
        gap: 10px;
        grid-template-columns: 1fr;
    }
}

/* Flexbox Utilities */
.flex {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .flex {
        flex-direction: column;
        gap: 8px;
    }
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .flex-between {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 12px;
    }
}

/* Tables - Responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background-color: #0a3d62;
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    th, td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    thead {
        display: none;
    }
    
    tbody, tr, td {
        display: block;
        width: 100%;
    }
    
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }
    
    td {
        text-align: right;
        padding-left: 40%;
        position: relative;
        border-bottom: none;
    }
    
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        color: #0a3d62;
    }
}

tbody tr:hover {
    background-color: #f9f9f9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    text-align: center;
}

.btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #0a3d62;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .btn-small {
        padding: 5px 10px;
        font-size: 0.8rem;
        width: auto;
    }
}

/* Forms */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

input, select, textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0a3d62;
    box-shadow: 0 0 0 2px rgba(10, 61, 98, 0.1);
}

@media (max-width: 480px) {
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Badges & Status Indicators */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #0a3d62;
    margin-bottom: 15px;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    h4 {
        font-size: 1rem;
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header h1 {
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
    margin: 0;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .action-buttons {
        gap: 4px;
    }
    
    .action-buttons .btn-small {
        flex: 1;
        min-width: 70px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 480px) {
    .empty-state {
        padding: 30px 15px;
    }
    
    .empty-state i {
        font-size: 36px;
    }
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .filter-section {
        padding: 15px;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #999;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-10 {
    padding: 10px;
}

.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }
}

.hidden-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hidden-desktop {
        display: block;
    }
}

/* Print Styles */
@media print {
    .page-header,
    .filter-section,
    .action-buttons,
    .lang-switcher {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card, table {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
