/* Reusable Component Styles */

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Stat Cards */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    position: relative;
    box-shadow: 2px 2px 0 #ddd;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 #ddd;
}

.stat-card-alert {
    border-color: #ffc107;
    background: #fffbf0;
}

.stat-card-alert:hover {
    box-shadow: 3px 3px 0 #ffc107;
}

.stat-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #333;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.badge-coin {
    background: #FFD700;
    color: #333;
}

.badge-coin-large {
    background: #FFD700;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.badge-point {
    background: #4CAF50;
    color: white;
}

.badge-frequency {
    background: #9b59b6;
    color: white;
    font-size: 0.85rem;
}

.badge-inactive {
    background: #95a5a6;
    color: white;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.badge-active {
    background: #27ae60;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.coin-badge {
    background: #FFD700;
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Cards */
.dashboard-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.card-body {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group .help-text,
.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #4CAF50;
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 0.75rem;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + * {
    font-weight: bold;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #4CAF50;
    background: #e8f5e9;
}

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

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

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.modal-content form {
    padding: 1.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Empty States */
.empty-state {
    color: #999;
    text-align: center;
    padding: 2rem;
}

.empty-state-large {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-state-large h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state-large p {
    color: #666;
    margin-bottom: 2rem;
}

/* Navigation Tabs */
.nav-btn {
    flex: 1;
    padding: 1rem;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #333;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    display: block;
}

.nav-btn:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.nav-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.inline-form {
    display: inline;
}

.mt-2 {
    margin-top: 2rem;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    /* Buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.875rem;
    }

    .btn-small {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* Cards */
    .dashboard-card {
        border-radius: 6px;
    }

    .card-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .card-header h2 {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-content form {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Form Groups */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Radio Groups */
    .radio-label {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    /* Navigation Tabs */
    .nav-btn {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
    }

    /* Empty States */
    .empty-state {
        padding: 1.5rem;
        font-size: 0.95rem;
    }

    .empty-state-large {
        padding: 3rem 1rem;
    }

    .empty-icon {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .btn {
        font-size: 0.8125rem;
    }

    .card-header h2 {
        font-size: 1rem;
    }

    .nav-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.4rem;
    }
}
