/* YPO Networking Platform - Unified Styles */

/*
 * Font Note: Trajan Pro is specified as the primary font.
 * To enable Trajan Pro, add the font files to static/fonts/ and uncomment:
 * @font-face {
 *     font-family: 'Trajan Pro';
 *     src: url('/static/fonts/TrajanPro-Regular.woff2') format('woff2');
 *     font-weight: 400;
 *     font-display: swap;
 * }
 */

/* CSS Variables for YPO Branding */
:root {
    --ypo-primary: #1e3a8a;          /* YPO Blue */
    --ypo-secondary: #3b82f6;        /* Lighter Blue */
    --ypo-accent: #60a5fa;           /* Accent Blue */
    --ypo-light: #eff6ff;            /* Light Blue Background */
    --ypo-white: #ffffff;
    --ypo-gray-50: #f9fafb;
    --ypo-gray-100: #f3f4f6;
    --ypo-gray-200: #e5e7eb;
    --ypo-gray-300: #d1d5db;
    --ypo-gray-400: #9ca3af;
    --ypo-gray-500: #6b7280;
    --ypo-gray-600: #4b5563;
    --ypo-gray-700: #374151;
    --ypo-gray-800: #1f2937;
    --ypo-gray-900: #111827;
    --ypo-success: #10b981;
    --ypo-warning: #f59e0b;
    --ypo-error: #ef4444;
    --ypo-error-light: #fef2f2;
    --ypo-success-light: #ecfdf5;
    --ypo-warning-light: #fffbeb;

    /* Typography */
    --font-primary: 'Trajan Pro', 'Times New Roman', serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--ypo-gray-700);
    background-color: var(--ypo-gray-50);
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    color: var(--ypo-gray-900);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.lead {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--ypo-gray-600);
    line-height: 1.6;
}

.tagline {
    font-size: 1.125rem;
    color: var(--ypo-accent);
    font-weight: var(--font-weight-medium);
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    min-height: 44px; /* Accessibility: minimum touch target */
}

.btn-primary {
    color: var(--ypo-white);
    background-color: var(--ypo-primary);
    border-color: var(--ypo-primary);
}

.btn-primary:hover {
    background-color: var(--ypo-secondary);
    border-color: var(--ypo-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    color: var(--ypo-primary);
    background-color: transparent;
    border-color: var(--ypo-primary);
}

.btn-outline:hover {
    color: var(--ypo-white);
    background-color: var(--ypo-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.125rem;
    min-height: 52px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:focus {
    outline: 2px solid var(--ypo-accent);
    outline-offset: 2px;
}

/* Forms */
.form-container {
    background: var(--ypo-white);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.form-section {
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--ypo-gray-200);
}

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

.form-section h3 {
    color: var(--ypo-primary);
    margin-bottom: var(--spacing-lg);
    font-size: 1.25rem;
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--ypo-gray-700);
    font-size: 0.875rem;
}

.required {
    color: var(--ypo-error);
}

input, select, textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--ypo-gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: var(--ypo-white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ypo-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

input:invalid, select:invalid, textarea:invalid {
    border-color: var(--ypo-error);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Messages */
.message {
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    border: 1px solid;
}

.message.success {
    background-color: var(--ypo-success-light);
    border-color: var(--ypo-success);
    color: #065f46;
}

.message.error {
    background-color: var(--ypo-error-light);
    border-color: var(--ypo-error);
    color: #991b1b;
}

.message.warning {
    background-color: var(--ypo-warning-light);
    border-color: var(--ypo-warning);
    color: #92400e;
}

.message.loading {
    background-color: var(--ypo-light);
    border-color: var(--ypo-accent);
    color: var(--ypo-primary);
}

/* Loading States */
.loading {
    color: var(--ypo-gray-500);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--ypo-gray-300);
    border-top: 2px solid var(--ypo-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #2B4C94 0%, #3D5BA9 50%, #4A6BC5 100%);
    color: var(--ypo-white);
    padding: var(--spacing-3xl) 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

.logo h1 {
    color: var(--ypo-white);
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.hero-text h2 {
    color: var(--ypo-white);
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
}

.hero-text .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Chapter Branding Section */
.chapter-branding {
    padding: var(--spacing-3xl) 0;
    background: var(--ypo-white);
    text-align: center;
}

.chapter-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xl);
}

.chapter-logo {
    max-width: 900px;
    width: 90%;
    height: auto;
}

.chapter-text {
    max-width: 800px;
    margin: 0 auto;
}

.chapter-tagline {
    font-size: 1.5rem;
    color: var(--ypo-gray-700);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.chapter-subtitle {
    font-size: 1.75rem;
    font-weight: var(--font-weight-semibold);
    color: var(--ypo-gray-900);
    margin-bottom: 0;
}

/* Features Section */
.features-section {
    padding: var(--spacing-3xl) 0;
    background: var(--ypo-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
}

.feature-card {
    text-align: center;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--ypo-gray-50);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
}

/* CTA Section */
.cta-section {
    padding: var(--spacing-3xl) 0;
    background: var(--ypo-light);
    text-align: center;
}

.cta-content h2 {
    color: var(--ypo-primary);
    margin-bottom: var(--spacing-lg);
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-2xl);
}

/* Benefits Section */
.benefits-section {
    padding: var(--spacing-3xl) 0;
    background: var(--ypo-white);
}

.benefits-section h2 {
    text-align: center;
    color: var(--ypo-primary);
    margin-bottom: var(--spacing-2xl);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
}

.benefit-item {
    padding: var(--spacing-lg);
}

.benefit-item h4 {
    color: var(--ypo-primary);
    margin-bottom: var(--spacing-sm);
}

/* Admin Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.card {
    background: var(--ypo-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--ypo-gray-200);
}

.card h2 {
    color: var(--ypo-primary);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--ypo-light);
    padding-bottom: var(--spacing-sm);
}

.header {
    background: var(--ypo-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--ypo-primary);
    margin-bottom: 0;
}

/* Statistics */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--ypo-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--ypo-gray-200);
}

.stat-number {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--ypo-primary);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--ypo-gray-600);
    text-transform: uppercase;
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-xs);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-lg);
    background: var(--ypo-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--ypo-gray-200);
    font-size: 0.875rem;
}

th {
    background-color: var(--ypo-gray-50);
    font-weight: var(--font-weight-semibold);
    color: var(--ypo-gray-700);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:hover {
    background-color: var(--ypo-gray-50);
}

/* Footer */
footer {
    background: var(--ypo-gray-800);
    color: var(--ypo-gray-300);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand h3 {
    color: var(--ypo-white);
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-links a {
    color: var(--ypo-gray-400);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover {
    color: var(--ypo-white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--ypo-gray-700);
    color: var(--ypo-gray-400);
    font-size: 0.875rem;
}

.footer-bottom a {
    background-color: #7c3aed;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.footer-bottom a:hover {
    background-color: #6d28d9;
}

/* Login Page */
.login-container {
    background: var(--ypo-white);
    padding: var(--spacing-3xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2B4C94 0%, #3D5BA9 50%, #4A6BC5 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }

    .logo h1 {
        font-size: 2.5rem;
    }

    .hero-text h2 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

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

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

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .chapter-logo {
        max-width: 100%;
        width: 95%;
        padding: 0 var(--spacing-sm);
    }

    .chapter-tagline {
        font-size: 1.125rem;
    }

    .chapter-subtitle {
        font-size: 1.25rem;
    }
}

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

    h2 {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .hero-text h2 {
        font-size: 1.75rem;
    }

    .form-container {
        padding: var(--spacing-xl);
    }

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--ypo-accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .btn, .header, footer {
        display: none;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }
}