/* ============================================
   SAMS - Study Abroad Management System
   Modern UI Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #64748b;
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* --- Navbar --- */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--color-primary-dark);
}

.navbar-brand svg {
    width: 28px;
    height: 28px;
}

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.navbar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.navbar-nav a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.navbar-nav a.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
}

.navbar-user span {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* --- Footer --- */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: auto;
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.page-header p {
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
}

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Auth Card (centered) --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--color-border);
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group input[readonly] {
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

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

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
}

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

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

.btn-outline {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

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

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

/* --- Dashboard Cards --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.dashboard-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.dashboard-card .card-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dashboard-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* --- Welcome Banner --- */
.welcome-banner {
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.welcome-banner h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.welcome-banner p {
    opacity: 0.85;
    font-size: 0.95rem;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--color-bg);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* --- Status Badges --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

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

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

/* --- Alerts --- */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.alert-error {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: #fecaca;
}

/* --- Inline Form (for tables) --- */
.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-form input {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    min-width: 120px;
}

.inline-form input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* --- University Detail Panel --- */
.detail-panel {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 2rem;
    margin-top: 1.5rem;
}

.detail-panel h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.detail-panel .detail-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.detail-panel .detail-meta strong {
    color: var(--color-text);
}

/* --- Section Spacing --- */
.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* --- Link helpers --- */
.text-center {
    text-align: center;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1.5rem;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--color-primary);
}

.auth-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline;
    margin: 0 0.25rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state p {
    font-size: 1rem;
}

/* --- Separator --- */
.separator {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

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

/* --- Landing Page: Hero --- */
.hero {
    position: relative;
    color: #fff;
    padding: 6rem 1.5rem;
    text-align: center;
    margin: -2rem -1rem 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85), rgba(37, 99, 235, 0.8), rgba(124, 58, 237, 0.75));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-outline-light {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

/* --- Landing Page: Partners --- */
.partners-section {
    padding: 4rem 1.5rem;
}

.partners-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.partners-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.partners-subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

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

.partner-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.partner-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.partner-img-wrapper {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: var(--color-bg);
}

.partner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.partner-card:hover .partner-img {
    transform: scale(1.05);
}

.partner-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.partner-aiub {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.partner-brac {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.partner-nsu {
    background: linear-gradient(135deg, #047857, #10b981);
}

.partner-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.partner-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.partner-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: auto;
}

.partner-card:hover .partner-link {
    text-decoration: underline;
}

/* --- Landing Page: Features --- */
.features-section {
    padding: 3rem 1.5rem 4rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.features-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.features-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.feature-item {
    padding: 1rem;
}

.feature-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    main {
        padding: 1.25rem 0.75rem;
    }

    .navbar-inner {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .navbar-user {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
    }

    .auth-card {
        padding: 1.75rem;
        margin: 0 0.5rem;
    }

    .welcome-banner {
        padding: 1.5rem;
    }

    .welcome-banner h1 {
        font-size: 1.25rem;
    }

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

    .hero {
        padding: 3.5rem 1rem;
        margin: -1.25rem -0.75rem 0;
        min-height: 320px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .partner-img-wrapper {
        height: 160px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .detail-panel .detail-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
}
