/* ===================================
   Car Sales Tracker - WordPress Plugin Stylesheet
   =================================== */

/* Login/Access Required Styles */
.cst-login-required,
.cst-access-denied {
    max-width: 500px;
    margin: 60px auto;
    padding: 20px;
}

.cst-login-box,
.cst-access-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.cst-login-box h2,
.cst-access-box h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: #2c3e50;
}

.cst-login-box p,
.cst-access-box p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 24px;
    line-height: 1.6;
}

.cst-login-button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.cst-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Reset and Base Styles */
.sales-tracker-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sales-tracker-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    margin: 20px 0;
    color: #2c3e50;
    line-height: 1.6;
}

/* Header Section */
.tracker-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.tracker-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.total-cars-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.total-cars-badge strong {
    font-size: 20px;
    font-weight: 700;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-selector label {
    font-size: 16px;
    font-weight: 500;
}

.month-dropdown {
    padding: 10px 16px;
    font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.month-dropdown:hover {
    background: rgba(255, 255, 255, 0.3);
}

.month-dropdown:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.month-dropdown option {
    background: #667eea;
    color: white;
}

/* Add Car Section */
.add-car-section {
    padding: 40px;
    border-bottom: 2px solid #e8ecef;
}

.add-car-section h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Form Styles */
.car-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
    background: #e8ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label span {
    font-size: 15px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e8ecef;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #d1d8dd;
}

/* Cars List Section */
.cars-list-section {
    padding: 40px;
    border-bottom: 2px solid #e8ecef;
}

.cars-list-section h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 24px;
    font-weight: 600;
}

.current-month {
    color: #667eea;
    font-weight: 700;
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Table Styles */
.cars-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cars-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cars-table thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    white-space: nowrap;
}

.cars-table tbody tr {
    border-bottom: 1px solid #e8ecef;
    transition: background-color 0.2s ease;
}

.cars-table tbody tr:hover {
    background-color: #f8fafc;
}

.cars-table tbody tr:last-child {
    border-bottom: none;
}

.cars-table tbody td {
    padding: 16px 12px;
    color: #4a5568;
    white-space: nowrap;
}

.cars-table tbody tr.no-data:hover {
    background-color: transparent;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-yes {
    background: #d4edda;
    color: #155724;
}

.badge-no {
    background: #f8d7da;
    color: #721c24;
}

/* Profit/Loss Styles */
.profit-positive {
    color: #28a745;
    font-weight: 700;
}

.profit-negative {
    color: #dc3545;
    font-weight: 700;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e8ecef;
    transform: scale(1.1);
}

/* Monthly Totals Section */
.monthly-totals-section {
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.monthly-totals-section h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Totals Grid */
.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.total-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.total-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.total-card-profit {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.total-card-profit.loss {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.total-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.total-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.total-highlight {
    color: #667eea;
}

.total-profit {
    color: #28a745;
    font-size: 32px;
}

.total-profit.negative {
    color: #dc3545;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tracker-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .tracker-header h1 {
        font-size: 24px;
    }

    .add-car-section,
    .cars-list-section,
    .monthly-totals-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .totals-grid {
        grid-template-columns: 1fr;
    }

    .total-value {
        font-size: 24px;
    }

    .total-profit {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .tracker-header h1 {
        font-size: 20px;
    }

    .month-dropdown {
        width: 100%;
    }

    .cars-table {
        font-size: 12px;
    }

    .cars-table thead th,
    .cars-table tbody td {
        padding: 10px 8px;
    }
}

/* All Cars Page Specific Styles */
.all-cars-view .cars-list-section {
    border-bottom: none;
}

.all-cars-list .subtitle {
    font-size: 16px;
    color: #718096;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.month-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f4fd;
    color: #0066cc;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.all-time-summary {
    padding: 40px;
    background: linear-gradient(135deg, #fef9e7 0%, #f9e79f 100%);
    border-bottom: 2px solid #f1c40f;
}

.all-time-summary h2 {
    color: #f39c12;
}

.all-time-summary .total-card {
    border-left-color: #f39c12;
}

.navigation-section {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
}

.navigation-section .btn {
    display: inline-block;
    text-decoration: none;
}

/* Print Styles */
@media print {
    .sales-tracker-container {
        box-shadow: none;
    }

    .form-actions,
    .actions {
        display: none;
    }

    .add-car-section {
        display: none;
    }

    .navigation-section {
        display: none;
    }
}
