/* ============================================
   GTA RP Farming - Stylesheet
   Theme: Dark/Light with Gold accents
   ============================================ */

/* CSS Variables */
:root {
    --color-primary: #FFD700;
    --color-secondary: #1a1a1a;
    --color-accent: #FFA500;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    /* Light theme defaults */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.theme-dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    --border-color: #404040;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--color-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.navbar-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.navbar-item {
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.navbar-item:hover {
    background-color: var(--bg-tertiary);
    opacity: 1;
}

.navbar-item.active {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

.navbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

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

.stats-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-footer {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group input[type="file"] {
    padding: 0.5rem;
}

.form-group input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.form-group input:disabled {
    background-color: var(--bg-tertiary);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: var(--color-success);
    color: white;
}

.badge-danger {
    background-color: var(--color-danger);
    color: white;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
}

.table tr:hover {
    background-color: var(--bg-tertiary);
}

.table .row-danger {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination-info {
    color: var(--text-secondary);
}

.period-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--color-warning);
    color: var(--color-warning);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header strong {
    display: block;
    margin-bottom: 0.25rem;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 800px;
}

.modal-image {
    max-width: 90%;
    width: auto;
}

.modal-image .modal-body {
    padding: 0;
}

.modal-image img {
    border-radius: 0 0 0.5rem 0.5rem;
    display: block;
}

/* ============================================
   Ranking Modal Styles
   ============================================ */
.ranking-section {
    margin-bottom: 2rem;
}

.ranking-section:last-child {
    margin-bottom: 0;
}

.ranking-section h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 1.25rem;
}

.ranking-podium {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.ranking-item:hover {
    transform: translateX(5px);
}

.ranking-position-1 {
    border-left: 4px solid #FFD700;
}

.ranking-position-2 {
    border-left: 4px solid #C0C0C0;
}

.ranking-position-3 {
    border-left: 4px solid #CD7F32;
}

.ranking-medal {
    font-size: 2rem;
    line-height: 1;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ranking-stats {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.record-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 0.5rem;
    border: 2px solid var(--color-primary);
    gap: 1.5rem;
}

.record-icon {
    font-size: 3rem;
    line-height: 1;
}

.record-info {
    flex: 1;
}

.record-holder {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.record-value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.record-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.5rem;
}

/* Tabs */
.tabs {
    width: 100%;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Login/Install Pages */
.login-container,
.install-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #2d2d2d 100%);
}

.login-card,
.install-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 450px;
}

.install-card {
    max-width: 600px;
}

.login-header,
.install-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    max-width: 120px;
    margin-bottom: 1rem;
}

.login-header h1,
.install-header h1 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.login-header p,
.install-header p {
    color: var(--text-secondary);
}

.login-form .form-group,
.install-form .form-group {
    margin-bottom: 1.5rem;
}

/* Company Balance */
.company-balance {
    text-align: center;
    padding: 2rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Credentials Box */
.credentials-box {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

.credentials-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    margin: 0;
}

/* Current Logo */
.current-logo {
    margin-bottom: 1rem;
}

.current-logo img {
    max-width: 200px;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

/* Info Section */
.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.info-highlight {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.html-content {
    line-height: 1.8;
}

.html-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* Text Utilities */
.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
    }

    .navbar-item {
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-buttons .btn {
        width: 100%;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
    }

    .balance-amount {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .navbar-title {
        font-size: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }
}
