/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Wells & Co Brand Colors */
    --primary-color: #152E3F; /* Deep navy blue - primary brand */
    --secondary-color: #ffffff; /* Clean white */
    --accent-color: #2D947A; /* Teal green - secondary brand */
    --accent-light: #4ECDC4; /* Light teal for highlights */
    --accent-subtle: #F0FFFE; /* Very light teal for backgrounds */
    --text-color: #152E3F; /* Navy for main text */
    --text-light: #5A7C92; /* Muted blue-gray for secondary text */
    --text-muted: #8FA8BC; /* Light blue-gray for muted text */
    --border-color: #E1E8ED; /* Light blue-gray for borders */
    --background-light: #F8FAFB; /* Very light blue-gray background */
    --shadow-light: 0 2px 12px rgba(21, 46, 63, 0.08);
    --shadow-medium: 0 4px 24px rgba(21, 46, 63, 0.12);
    --shadow-heavy: 0 8px 40px rgba(21, 46, 63, 0.16);
    --border-radius: 12px; /* Modern rounded corners */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #152E3F, #1F3A4F);
    --gradient-accent: linear-gradient(135deg, #2D947A, #4ECDC4);

    /* Status colors - complementary to brand palette */
    --success-bg: #E8F5F0;
    --success-text: #0F5132;
    --success-border: #B8E6D3;
    --warning-bg: #FFF8E1;
    --warning-border: #FFE082;
    --warning-text: #8A6914;
    --error-bg: #FFEBEE;
    --error-text: #C62828;
    --error-border: #FFCDD2;
}

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--background-light) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1F3A4F 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(45, 148, 122, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.company-logo {
    max-height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(21, 46, 63, 0.15));
    display: block;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-family: 'Raleway', sans-serif;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Fallback Warning Banner */
.fallback-warning {
    background: var(--warning-bg);
    border: 2px solid var(--warning-border);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
    transition: opacity 0.3s ease;
}

.warning-content {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.warning-icon {
    color: var(--warning-text);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning-text {
    flex-grow: 1;
    color: var(--warning-text);
    font-size: 0.95rem;
}

.warning-text strong {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.warning-detail {
    opacity: 0.8;
    font-size: 0.85rem;
}

.warning-dismiss {
    background: none;
    border: none;
    color: var(--warning-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0.7;
}

.warning-dismiss:hover {
    opacity: 1;
    background: rgba(133, 100, 4, 0.1);
}

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

/* Search Container */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--secondary-color);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    font-weight: 400;
    color: var(--primary-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(21, 46, 63, 0.15);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1rem;
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
}

.clear-search:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0;
}

.category-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
    font-weight: 700;
    box-shadow: var(--shadow-medium);
}

/* Applications Grid */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    flex-grow: 1;
}

/* App Card */
.app-card {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-color);
    border-top-color: var(--accent-color);
}

.app-card-header {
    padding: 2rem 2rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.app-icon-container {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius);
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.app-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-category-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.app-card-body {
    padding: 0 2rem 1.5rem;
    flex-grow: 1;
}

.app-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-family: inherit;
    letter-spacing: -0.02em;
}

.app-description {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.95rem;
    font-style: normal;
}

.app-card-footer {
    padding: 0 2rem 2rem;
    margin-top: auto;
}

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
    font-family: inherit;
    letter-spacing: -0.02em;
    border: 2px solid var(--accent-color);
}

.app-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.app-link i {
    font-size: 0.875rem;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* No Results State */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    border-top: 3px solid var(--primary-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--accent-subtle) 100%);
    font-family: 'Raleway', sans-serif;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .app-card-header,
    .app-card-body,
    .app-card-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .category-filter {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .search-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }

    .search-icon {
        left: 0.875rem;
    }

    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }

    .welcome-text {
        font-size: 1rem;
    }

    .app-card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }

    .app-icon-container {
        width: 56px;
        height: 56px;
    }

    .app-icon {
        width: 32px;
        height: 32px;
    }
}

/* Print Styles */
@media print {
    .search-container,
    .category-filter {
        display: none;
    }

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

    .app-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
        break-inside: avoid;
    }
}