/* Mobile-first CSS for Sales Tracker */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.header p {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(149, 165, 166, 0.3);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.table tr:hover {
    background-color: #f8f9fa;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Alerts */
.alert {
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 5px solid;
    position: relative;
    font-weight: 500;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert::before {
    font-size: 1.5rem;
    font-weight: bold;
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.25) 0%, rgba(46, 204, 113, 0.2) 100%);
    border-color: #27ae60;
    color: #0f4c1a;
    border: 3px solid #27ae60;
    font-weight: 600;
}

.alert-success::before {
    content: '✅';
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.25) 0%, rgba(192, 57, 43, 0.2) 100%);
    border-color: #e74c3c;
    color: #5a1a1a;
    border: 3px solid #e74c3c;
    font-weight: 600;
}

.alert-danger::before {
    content: '❌';
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.25) 0%, rgba(230, 126, 34, 0.2) 100%);
    border-color: #f39c12;
    color: #6b5200;
    border: 3px solid #f39c12;
    font-weight: 600;
}

.alert-warning::before {
    content: '⚠️';
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* New Grouped Navigation Styles */
.nav-groups {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex: 1;
    padding: 6px 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.nav-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    padding: 0 4px;
    position: relative;
}

.nav-group-label::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 4px;
    right: 4px;
    height: 1px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 1px;
    opacity: 0.5;
}

.nav-group-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-group-buttons .btn {
    text-align: left;
    justify-content: flex-start;
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 160px;
    white-space: nowrap;
    border-radius: 8px;
}

.nav-account {
    display: flex;
    align-items: flex-start;
    margin-left: auto;
}

.nav-account .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: 100px;
    border-radius: 8px;
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.nav-dropdown-btn:hover {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 73, 94, 0.4);
}

.nav-dropdown-btn::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-btn::after {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 5px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.nav-dropdown-content a {
    color: #2c3e50;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f8f9fa;
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

.nav-dropdown-content a:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateX(5px);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main navigation buttons */
.nav-main-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.nav-main-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.nav-main-btn.active {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.nav-main-btn.active:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    /* Responsive styles for grouped navigation */
    .nav-groups {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .nav-group {
        min-width: auto;
        width: 100%;
    }
    
    .nav-group-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-group-buttons .btn {
        min-width: auto;
        flex: 1;
        min-width: 140px;
        text-align: center;
        justify-content: center;
    }
    
    .nav-account {
        margin-left: 0;
        margin-top: 12px;
        justify-content: center;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .alert {
        padding: 15px 20px;
        font-size: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .alert::before {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 6px 8px;
    }
    
    /* Mobile styles for grouped navigation */
    .nav {
        padding: 10px 12px;
        justify-content: center;
        text-align: center;
    }
    
    .nav-groups {
        align-items: center;
        width: 100%;
    }
    
    .nav-group {
        width: 100%;
        align-items: center;
    }
    
    .nav-group-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .nav-group-buttons .btn {
        min-width: auto;
        width: 100%;
        padding: 10px 12px;
        text-align: center;
        justify-content: center;
    }
    
    .nav-group-label {
        text-align: center;
        width: 100%;
    }
    
    .nav-account {
        width: 100%;
        justify-content: center;
    }
    
    .alert {
        padding: 12px 15px;
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    .alert::before {
        font-size: 1.8rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .btn, .nav {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
    color: white;
}

.badge-primary {
    background-color: #3498db;
}

.badge-danger {
    background-color: #e74c3c;
}

.badge-success {
    background-color: #27ae60;
}

.badge-warning {
    background-color: #f39c12;
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Form submit button container */
.form-submit {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    position: absolute;
    right: 15px;
    top: 15px;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal.show {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 0;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .close {
        right: 10px;
        top: 10px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .modal.show {
        padding: 5px;
    }
    
    .modal-content {
        width: 98%;
        padding: 15px;
        max-height: 80vh;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .modal-content .btn {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 80px;
    }
}

/* Small buttons for table actions */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    min-width: auto;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
} 