/* ==========================================================================
   Components - Compatible with Both Old and New Styles
   ========================================================================== */

/* Original Buttons (for other pages) */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition, 0.3s ease);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary, #CCFF00);
    color: var(--text-primary, #1A1A1A);
    box-shadow: 0 4px 12px rgba(204, 255, 0, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark, #A3CC00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 255, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary, #5B4B8A);
    border: 2px solid var(--secondary, #5B4B8A);
}

.btn-secondary:hover {
    background: var(--secondary, #5B4B8A);
    color: white;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Original Cards */
.card {
    background: var(--bg-white, #FFFFFF);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-light, #F0F0F0);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #1A1A1A);
}

.card-body {
    margin-bottom: 1.5rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Original Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg-white, #FFFFFF);
    color: var(--text-primary, #1A1A1A);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary, #CCFF00);
    box-shadow: 0 0 0 3px rgba(204, 255, 0, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-select {
    background-color: var(--bg-white, #FFFFFF);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234A5568' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-error {
    color: #E53E3E;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--text-light, #718096);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Original Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
}

.badge-primary {
    background: rgba(204, 255, 0, 0.15);
    color: #7A9900;
    border: 1px solid rgba(204, 255, 0, 0.3);
}

.badge-success {
    background: rgba(72, 187, 120, 0.15);
    color: #2F855A;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.badge-warning {
    background: rgba(237, 137, 54, 0.15);
    color: #C05621;
    border: 1px solid rgba(237, 137, 54, 0.3);
}

/* Original Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgba(204, 255, 0, 0.1);
    color: #7A9900;
    border-left: 4px solid var(--primary, #CCFF00);
    border: 1px solid rgba(204, 255, 0, 0.2);
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: #2F855A;
    border-left: 4px solid #48BB78;
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.alert-error {
    background: rgba(229, 62, 62, 0.1);
    color: #C53030;
    border-left: 4px solid #E53E3E;
    border: 1px solid rgba(229, 62, 62, 0.2);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color, #E2E8F0);
    border-top-color: var(--primary, #CCFF00);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    list-style: none;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-light, #718096);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
    color: var(--border-color, #E2E8F0);
}

.breadcrumb-item.active {
    color: var(--text-primary, #1A1A1A);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-light, #F0F0F0);
    margin: 3rem 0;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-light, #F8F9FA);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #CCFF00) 0%, var(--secondary, #5B4B8A) 100%);
    transition: width 0.3s ease;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light, #F0F0F0);
    margin-bottom: 2rem;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary, #4A5568);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--text-primary, #1A1A1A);
}

.tab.active {
    color: var(--primary, #CCFF00);
    border-bottom-color: var(--primary, #CCFF00);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal {
    background: var(--bg-white, #FFFFFF);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light, #F0F0F0);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary, #1A1A1A);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light, #718096);
}

.modal-close:hover {
    color: var(--text-primary, #1A1A1A);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 3rem; }

.hidden { display: none; }
.visible { display: block; }

/* Ensure old page elements still look good */
.section {
    padding: 4rem 0;
}

.section-header {
    max-width: 800px;
    margin-bottom: 3rem;
}

.section-header.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-intro {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary, #4A5568);
}

.centered {
    text-align: center;
}