/* TODO: Minify before prod and add to CDN */

/* Base Styles */
html {
    position: relative;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background-color: #fafafa;
}

main {
    margin-bottom: auto;
}

.footer {
    width: 100%;
}

.hover-card {
    transition: transform 0.2s ease-in-out;
}

.hover-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    margin: 0 auto 1.25rem;
    transition: all 0.3s ease;
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--bs-primary);
    transition: all 0.3s ease;
}

.feature-icon img {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.home-card:hover .feature-icon {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    transform: translateY(-2px);
}

.home-card:hover .feature-icon i {
    transform: scale(1.1);
}

.card {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.card.shadow-sm {
    box-shadow: rgba(17, 12, 46, 0.15) 0px 10px 25px -5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-body {
    padding: 2rem;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 300px);
    padding: 1rem;
}

.login-card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
}

.hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cursor-pointer {
    cursor: pointer;
}

#global-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner-text {
    margin-top: 10px;
    font-weight: 500;
}

@media (max-width: 576px) {
    .card-body {
        padding: 1.5rem;
    }
    
    .login-container {
        min-height: calc(100vh - 200px);
    }
}

@media (max-width: 375px) {
    .card-body {
        padding: 1rem;
    }
}

/* Home Page Styles */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--bs-primary);
    border-radius: 2px;
}

/* Apps Section */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.app-card:hover .app-icon {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    transform: scale(1.05);
}

.app-icon i {
    font-size: 1.5rem;
    color: var(--bs-primary);
}

.app-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.app-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #2c3e50;
}

.app-card p {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 1.25rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* Settings Section */
.settings-section {
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.settings-card:hover {
    transform: translateY(-4px);
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.settings-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.settings-card:hover .settings-icon {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    transform: scale(1.05);
}

.settings-icon i {
    font-size: 1.25rem;
    color: var(--bs-primary);
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #2c3e50;
}

.settings-card p {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 1.25rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn i {
    font-size: 0.813rem;
    transition: transform 0.2s ease;
}

.btn:hover i {
    transform: translateX(2px);
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    transform: translateY(-1px);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .home-container {
        padding: 1.75rem 1.25rem;
    }

    .home-content {
        gap: 2rem;
    }

    .settings-section {
        padding: 1.75rem;
    }
}

@media (max-width: 768px) {
    .home-container {
        padding: 1.25rem 1rem;
    }

    .home-content {
        gap: 2rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .settings-section {
        padding: 1.5rem;
    }

    .apps-grid,
    .settings-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }

    .app-card,
    .settings-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .home-container {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .apps-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .app-card,
    .settings-card {
        padding: 1.25rem;
    }

    .btn {
        width: 100%;
    }

    .position-relative .btn {
        right: 0;
        padding: 0.5rem;
    }
    
    .position-relative .form-control {
        padding-right: 2.5rem;
    }
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

/* Password Input Styles */
.position-relative {
    position: relative;
}

.position-relative .form-control {
    padding-right: 2.5rem;
}

.position-relative .btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    z-index: 2;
    margin: 0;
    border: none;
    background: transparent;
    width: auto;
    min-width: auto;
}

.position-relative .btn i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.position-relative .btn:hover i {
    color: var(--bs-primary);
}

.enable-2fa-container {
    width: 100%;
}

.step-section {
    position: relative;
    padding-bottom: 1.5rem;
}

.step-section:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 48px;
    bottom: 0;
    width: 2px;
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    z-index: 1;
}

.app-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.app-name {
    font-weight: 500;
    color: #2c3e50;
}

.app-link {
    color: var(--bs-primary);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.app-link:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    text-decoration: none;
}

.qr-section {
    max-width: 300px;
    margin: 0 auto;
}

.code-box {
    background: rgba(var(--bs-primary-rgb), 0.05);
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.verification-form .form-control {
    font-size: 1.25rem;
    letter-spacing: 2px;
    text-align: center;
}

@media (max-width: 576px) {
    .step-section {
        padding-bottom: 1rem;
    }

    .app-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .app-name {
        margin-bottom: 0.25rem;
    }
}

.dropdown-menu {
    padding: 0.5rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    min-width: 240px;
    margin-top: 0.5rem;
    animation: dropdownFadeIn 0.2s ease;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #2c3e50;
    transition: all 0.2s ease;
    margin: 0.125rem 0;
}

.dropdown-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    transform: translateX(4px);
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.06);
}

.dropdown-item.text-danger {
    color: #dc3545;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link.dropdown-toggle {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link.dropdown-toggle:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.nav-link.dropdown-toggle::after {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

@media (max-width: 576px) {
    .dropdown-menu {
        min-width: 200px;
        margin-top: 0.25rem;
    }

    .dropdown-item {
        padding: 0.625rem 0.875rem;
    }
}