/**
 * Common CSS styles shared across all pages
 * Reduces duplication and improves load time
 */

/* Time Display */
.time-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    display: none;
    z-index: 9999;
}

/* Page Content Styles */
.main-content h1 {
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    font-size: 0.8rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Alert Messages */
.alert {
    padding: 0.8rem;
    border-radius: 0.3rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-text);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

.btn-primary {
    background: var(--btn-primary);
    color: white;
}

.btn-secondary {
    background: var(--btn-secondary);
    color: white;
}

.btn-danger {
    background: var(--btn-danger);
    color: white;
}

.btn-success {
    background: var(--btn-success);
    color: white;
}

.btn-warning {
    background: var(--btn-warning);
    color: white;
}

.btn-info {
    background: var(--btn-info);
    color: white;
}

/* Tables */
.users-table,
.financial-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.users-table th,
.financial-table th {
    background: var(--table-header);
    color: var(--text-primary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.users-table td,
.financial-table td {
    padding: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.users-table tr:hover,
.financial-table tr:hover {
    background: var(--table-hover);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-admin {
    background: var(--btn-danger);
    color: white;
}

.badge-user {
    background: var(--btn-secondary);
    color: white;
}

/* Sections */
.admin-section,
.profile-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.admin-section h2,
.profile-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

/* Cache Info */
.cache-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Text Utilities */
.text-muted {
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .time-display {
        font-size: 0.65rem;
        margin-top: 0.3rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }
}
