/**
 * Customer Data Management System Styles
 * Version: 1.0.0
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c 0%, #2a5298 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

header {
    background: #4a6fa5;
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.app-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.auth-section, .data-section, .admin-section, .dashboard-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #4a6fa5;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    border-color: #4a6fa5;
    outline: none;
}

button {
    padding: 10px 16px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button i {
    margin-right: 6px;
    font-size: 13px;
}

button:hover {
    background-color: #385d8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: #e74c3c;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-warning:hover {
    background-color: #d35400;
}

.btn-outline {
    background: transparent;
    border: 2px solid #4a6fa5;
    color: #4a6fa5;
    padding: 8px 14px;
}

.btn-outline:hover {
    background: #4a6fa5;
    color: white;
}

.btn-info {
    background-color: #17a2b8;
    padding: 8px 14px;
}

.btn-info:hover {
    background-color: #138496;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.data-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.data-table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #4a6fa5;
    color: white;
    position: sticky;
    top: 0;
    font-size: 13px;
}

.data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.data-table tr:hover {
    background-color: #e6f7ff;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.hidden {
    display: none;
}

.error-message {
    color: #e74c3c;
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
}

.success-message {
    color: #2ecc71;
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a6fa5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 10px 16px;
    background: #ddd;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.tab-button.active {
    background: #4a6fa5;
    color: white;
}

.admin-panel {
    margin-top: 20px;
}

.admin-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.admin-user-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.admin-user-card h4 {
    color: #4a6fa5;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    font-size: 15px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.dashboard-card h3 {
    color: #4a6fa5;
    margin-bottom: 8px;
    font-size: 15px;
}

.dashboard-card .value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #2c3e50;
}

.commission-settings {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.commission-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
    font-size: 14px;
}

.commission-total {
    font-weight: bold;
    font-size: 1rem;
    color: #2c3e50;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #4a6fa5;
}

.export-buttons {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.user-commission-form {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    border-left: 4px solid #4a6fa5;
}

.user-commission-form h5 {
    margin-bottom: 8px;
    color: #4a6fa5;
    font-size: 14px;
}

.commission-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

.add-user-form {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.checkbox-group input {
    margin-right: 8px;
    width: auto;
}

/* Mobile-specific styles for the customer form */
.customer-form-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.customer-form-header h2 {
    color: #4a6fa5;
    font-size: 1.4rem;
}

.customer-form-header .step-indicator {
    background: #4a6fa5;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .data-form {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .admin-user-list {
        grid-template-columns: 1fr;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .commission-fields {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    /* Specific mobile styles for customer form */
    .customer-form-container {
        background: white;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        padding: 14px;
        font-size: 16px; /* Better for mobile touch */
    }
    
    .checkbox-group {
        margin: 20px 0;
    }
    
    button[type="submit"] {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
}