/* Mobile-First Responsive CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile containers */
.container {
    width: 100%;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Typography for mobile */
h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    text-align: center;
}

h2 {
    font-size: 1.4rem;
    margin: 1rem 0;
    color: #34495e;
}

h3 {
    font-size: 1.2rem;
    margin: 0.8rem 0;
    color: #7f8c8d;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Forms - Mobile Optimized */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px; /* Prevents iOS zoom */
    background: #fff;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* File upload */
input[type="file"] {
    padding: 10px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 6px;
    width: 100%;
}

/* Checkboxes for priority */
fieldset {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin: 1rem 0;
    background: #f8f9fa;
}

legend {
    font-weight: 600;
    color: #2c3e50;
    padding: 0 10px;
}

label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Buttons */
button,
input[type="submit"],
.button {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin: 5px 0;
    transition: all 0.3s;
}

button:hover,
input[type="submit"]:hover,
.button:hover {
    background: linear-gradient(to right, #2980b9, #1c5a7a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Tables - Mobile Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Minimum width for tables */
}

th {
    background: #3498db;
    color: white;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    font-size: 0.9rem;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background: #f8f9fa;
}

tr:hover {
    background: #e8f4fc;
}

/* Action buttons in tables */
.actions {
    white-space: nowrap;
}

.actions form {
    display: inline-block;
    margin: 2px;
}

.actions button {
    width: auto;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin: 2px;
}

/* Status badges */
.status-pending { 
    color: #e67e22;
    font-weight: 600;
}
.status-approved { 
    color: #27ae60;
    font-weight: 600;
}
.status-completed { 
    color: #3498db;
    font-weight: 600;
}

/* Footer */
.footer-credit {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* QR Code display */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

/* Login page specific */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Review page */
.review-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.review-section p {
    margin: 10px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

/* Media Queries for larger screens */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .container {
        padding: 25px;
    }
    
    /* Two-column layout for forms on desktop */
    .form-row {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .form-row .form-group {
        flex: 1 1 calc(50% - 20px);
        min-width: 250px;
    }
    
    /* Full width for specific fields */
    .form-group.full-width {
        flex: 1 1 100%;
    }
    
    /* Buttons inline on desktop */
    .button-group {
        display: flex;
        gap: 10px;
    }
    
    .button-group button {
        width: auto;
        flex: 1;
    }
    
    /* Table becomes normal width */
    table {
        min-width: auto;
    }
    
    /* Login form wider on desktop */
    .login-container {
        max-width: 500px;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 30px;
    }
    
    .container {
        padding: 30px;
    }
    
    .form-row .form-group {
        flex: 1 1 calc(33.333% - 20px);
    }
}

/* Print styles */
@media print {
    button, .actions, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
