/* ========================================
   Global Base Styles
   Import variables.css first for design tokens
   ======================================== */

/* Global Resets */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--color-text-primary);
}

#app {
    height: 100%;
}

/* Main App Layout */
.App {
    max-width: 1900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    min-height: 100vh;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

    header h1 {
        margin: 0;
        font-size: 3rem;
        font-weight: 800;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.02em;
    }

    header p {
        margin: 0.75rem 0 0 0;
        color: var(--color-text-secondary);
        font-size: 1.125rem;
        font-weight: 500;
    }

/* Main Content Area */
main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Search and Toolbar Row */
.search-toolbar-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

    .search-toolbar-row .search-bar {
        flex: 1;
        min-width: 300px;
        margin: 0;
    }

    .search-toolbar-row .toolbar {
        flex-shrink: 0;
    }

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading Overlay for Processing Operations */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in-out;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl, 16px);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    margin: 2rem 0;
}

.empty-state h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary, #1f2937);
    margin: 0 0 1rem 0;
}

.empty-state p {
    font-size: 1.125rem;
    color: var(--color-text-secondary, #6b7280);
    margin: 0 0 2rem 0;
}

.empty-state .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-state .btn-primary {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.empty-state .btn-primary:hover {
    background: var(--color-primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.loading-spinner {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem 3rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

    .loading-spinner p {
        margin: 0;
        color: var(--color-text-secondary);
        font-weight: 500;
    }

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-primary {
    color: var(--color-primary);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    position: relative;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-dismissible {
    padding-right: 3rem;
}

.btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.25rem 1rem;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

    .btn-close:hover {
        opacity: 0.75;
    }



/* Blazor Validation Styles */
.validation-message {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-errors {
    color: var(--color-danger);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .search-toolbar-row {
        flex-direction: column;
    }

        .search-toolbar-row .search-bar {
            width: 100%;
        }
}
