/* CSS Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #dc143c;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #9ca3af;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile First Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #ffff;
    min-height: 100vh;
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    background: white;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Header & Navigation */
.main-header {
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-menu a:hover {
    background: var(--primary);
    color: white;
}

/* Equipment Cards */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.equipment-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.equipment-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.price-tag {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.5rem;
}

.availability-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.available {
    background: #d1fae5;
    color: var(--success);
}

.unavailable {
    background: #fee2e2;
    color: var(--danger);
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.masked {
    letter-spacing: 0.2em;
    font-family: monospace;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Date Picker */
.date-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.date-input {
    position: relative;
}

.date-input input {
    padding-right: 2.5rem;
}

.date-input::after {
    content: '📅';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Admin Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
    margin-top: 0.5rem;
}

/* Table Styles */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: left;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Invoice */
.invoice-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.invoice-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.invoice-number {
    color: var(--primary);
    font-weight: bold;
}

.invoice-table {
    width: 100%;
    margin: 1.5rem 0;
}

.invoice-table td {
    padding: 0.75rem;
}

.invoice-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .equipment-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .date-picker {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* Print Styles for Invoice */
@media print {
    .no-print {
        display: none;
    }
    
    .invoice-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    body {
        background: #ffff;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    border-left: 4px solid var(--success);
    animation: slideIn 0.3s ease;
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* Rental Management Styles */
.rental-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid #007bff;
    transition: transform 0.3s ease;
}

.rental-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.rental-card.overdue {
    border-left-color: #dc3545;
    background-color: #fff5f5;
    animation: pulse 2s infinite;
}

.rental-card.status-approved {
    border-left-color: #28a745;
}

.rental-card.status-active {
    border-left-color: #17a2b8;
}

.rental-card.status-completed {
    border-left-color: #6c757d;
}

.rental-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-approved { background: #d4edda; color: #155724; }
.status-badge.status-active { background: #d1ecf1; color: #0c5460; }
.status-badge.status-overdue { background: #f8d7da; color: #721c24; }

.rental-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.detail-item i {
    color: #007bff;
    font-size: 1.2rem;
}

.call-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #28a745;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    background: #d4edda;
    transition: all 0.3s ease;
}

.call-btn:hover {
    background: #c3e6cb;
    color: #155724;
    text-decoration: none;
}

.countdown {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 5px 10px;
    background: #343a40;
    color: white;
    border-radius: 5px;
    display: inline-block;
}

.overdue-text {
    color: #dc3545;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab:hover {
    background: #dee2e6;
}

.tab.active {
    background: #eb3c25ff;
    color: white;
}

.rental-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Damage Assessment Styles */
.damage-assessment {
    background: #fff8e1;
    border: 2px dashed #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.damage-severity-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.damage-severity {
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
}

.damage-severity[data-severity="minor"] {
    background: #d4edda;
    color: #155724;
}

.damage-severity[data-severity="moderate"] {
    background: #fff3cd;
    color: #856404;
}

.damage-severity[data-severity="major"] {
    background: #f8d7da;
    color: #721c24;
}

.damage-severity[data-severity="total"] {
    background: #dc3545;
    color: white;
}

.damage-severity:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.damage-severity.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Image Preview Styles */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.image-preview {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rental-details {
        grid-template-columns: 1fr;
    }
    
    .rental-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rental-actions {
        flex-direction: column;
    }
    
    .rental-actions .btn {
        width: 100%;
    }
}

/* Print Styles for Rental Reports */
@media print {
    .rental-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .rental-actions, .tabs, .call-btn {
        display: none !important;
    }
}