﻿/* CSS Variables for easy theme adjustments */
:root {
    --bg-color: #e8e8ef;
    --text-color: #1E3A69;
    --nav-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-icon-color: #94a3b8;
    --sidebar-icon-hover: #ffffff;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --header-height: 60px;
    --sidebar-width: 64px;
    --footer-height: 48px;
    --text-secondary-color: #ED782B;
}

@layer base {
    h1 {
        @apply text-4xl font-bold tracking-tight text-gray-900;
    }

    h2 {
        @apply text-3xl font-semibold tracking-tight text-gray-800;
    }

    h3 {
        @apply text-2xl font-semibold text-gray-800;
    }
}

.hidden {
    display: none;
}

.warning {
    color: #f87171; /* Tailwind's red-400 */
    font-size: 0.875rem; /* 14px */
    margin-top: 0.25rem; /* 4px */
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.text-secondary {
    color: var(--text-secondary-color);
}


/* Top Title Bar */
.navbar {
    height: var(--header-height);
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: 66px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
}

button {
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}


.account-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .account-btn:hover {
        background-color: var(--primary-hover);
    }

/* App Container (Sidebar + Content) */
.app-container {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
}

/* Left Icon Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 1.5rem;
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    z-index: 90;
}

.sidebar-icon {
    color: var(--sidebar-icon-color);
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

    .sidebar-icon:hover {
        color: var(--sidebar-icon-hover);
        background-color: rgba(255, 255, 255, 0.1);
    }

    .sidebar-icon.active {
        color: #ffffff;
        background-color: var(--primary-color);
    }


.card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Footer */
.footer {
    height: var(--footer-height);
    background-color: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #64748b;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}


/* Center wrapper occupying available vertical & horizontal space */
.activity-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px); /* Adjust based on your header/footer height */
    padding: 1rem;
}

/* Responsive Login Card */
.activity-card {
    /* Dynamic width: Minimum 300px, preferred 50% of viewport width, maximum 480px */
    width: clamp(300px, 50vw, 640px);
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

    .activity-card h2 {
        margin-bottom: 1.5rem;
        font-size: 1.5rem;
        color: #0f172a;
        text-align: center;
    }

/* Form controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

    .form-group label {
        font-size: 0.875rem;
        font-weight: 500;
        color: #334155;
    }


    .form-group input, select {
        width: 100%;
        padding: 0.75rem 1rem;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        font-size: 1rem;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .form-group input:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
}

    .login-btn:hover {
        background-color: #1d4ed8;
    }

/* Small screen optimization (Mobile) */
@media (max-width: 480px) {
    .activity-card {
        width: 92vw; /* Takes up almost full width on phones */
        padding: 1.5rem 1.25rem;
        overflow-x: auto;
    }
}

.margin-auto {
    margin: auto;
}

dialog {
    /* 1. Strip away the default WebKit constraints */
    max-width: 75vw;
    max-height: 85dvh; /* 85% of the dynamic viewport height */
    overflow-y: auto; /* Gives you a scrollbar if the text exceeds the screen */
    margin: auto;
    padding: 16px;
}

.title {
    font-size: 1.4rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.toolbar {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-content: end;
}

table tr td {
    padding: 8px;
}

input, select, textarea, ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 4px;
    background-color: white;
    opacity: 1;
    padding: 4px;
    border: 1px solid #dddddd;
    box-shadow: 2px 2px 2px 0px rgba(0,0,0,0.4);
}

.page {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1rem;
}

.form-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 15px;
    align-items: center;
}

    /* Make profile picture container align nicely in the grid */
    .form-layout .profile-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

@media screen and (max-width: 768px) {
    label {
        text-decoration: underline;
    }

    .form-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

        /* Push the label slightly apart from the previous field when stacked */
        .form-layout label,
        .form-layout .form-label {
            margin-top: 10px;
        }

    .sidebar {
        display: none;
    }

    .page {
        margin-left: 0;
    }

    #account-btn span {
        display:none;
    }
    .activity-wrapper {
        padding: 0.75rem; /* Slightly reduce wrapper padding on tiny screens */
    }

    .activity-card {
        width: 100%; /* Prevents the card from overflowing the viewport */
        min-width: unset; /* Removes the 300px constraint that causes overflow on narrow screens */
        padding: 1.25rem 1rem;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .activity-wrapper {
        padding: 0;
    }

    .activity-card {
        width: 100%;
        min-width: 0; /* Overrides the 300px clamp minimum that causes overflow */
        padding: 1.25rem 1rem; /* Reduces inner card padding so content fits safely */
    }
}
