/* Global Styles & Variables */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #6D28D9;
    --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    --secondary-color: #FBBF24;
    --accent-color: #EC4899;
    --text-light: #ffffff;
    --text-dark: #1f2937;
    --bg-color: #7C3AED;
    --radius-lg: 24px;
    --radius-md: 12px;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    background-image: radial-gradient(circle at 10% 20%, rgb(139, 92, 246) 0%, rgb(111, 76, 197) 90%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    /* Prevent scrolling on 100vh view if possible */
}

/* Main Container - Full Screen Dashboard */
.app-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 95vw;
    height: 90vh;
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-columns: 35% 65%;
    /* Adjusted ratios */
}

/* Left Side - Interaction Area */
#uploadForm {
    padding: 10px 40px 40px 40px;
    display: flex;
    flex-direction: column;
}

.interaction-pane {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hard limit to prevent scrolling */
    background: white;
    position: relative;

    /* Hide scrollbar for Chrome, Safari and Opera */
    &::-webkit-scrollbar {
        display: none;
    }

    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Header within Pane */
header {
    margin-bottom: 0;
    padding: 15px 30px 5px 30px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo {
    width: 150px;
    height: auto;
    margin-bottom: 2px;
    margin-left: -5px;
    display: block;
    mix-blend-mode: multiply;
}

h1 {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.1;
}

.subtitle {
    color: #6b7280;
    font-size: 0.85rem;
}

/* Form Styles */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.input-group {
    margin-bottom: 8px;
}

.input-group label {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
    color: #4B5563;
    font-size: 0.8rem;
}

.input-group .login-input,
.tags-input {
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
}

.upload-area {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
    margin-bottom: 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-height: 160px;
    /* Highly compressed */
    z-index: 5;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f3f0ff;
    transform: scale(1.01);
    /* Subtle pop */
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 1.8rem;
    margin-bottom: 2px;
    display: block;
}

.upload-text {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 700;
}

.upload-subtext {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--secondary-color);
    color: #1f2937;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4b5563;
}

.btn-record {
    background: #EF4444;
    color: white;
}

.btn-record:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit {
    background: var(--primary-gradient);
    color: white;
    width: 100%;
    margin-top: 10px;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* Right Side - Visual/Results */
.visual-pane {
    background: #fdfdfd;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #f1f5f9;
}

/* Hero Image */
.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fills the entire space */
    object-position: center;
    transition: transform 0.7s ease;
}

.hero-image:hover {
    transform: scale(1.05);
}

/* Results Overlay inside the visual pane */
#resultsArea {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Center the results */
    transform: translate(-50%, -50%);
    width: 90%;
    /* Take up most of the visual pane */
    height: 90%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
    padding: 40px;
    overflow-y: auto;
    display: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 5px;
}

pre {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

/* Loading */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-weight: 600;
    color: var(--primary-color);
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
        aspect-ratio: auto;
        max-height: none;
    }

    .visual-pane {
        display: none;
        /* Hide image on small screens or move to top */
    }

    #resultsArea {
        position: relative;
        height: auto;
        display: block;
        /* If results exist */
    }
}

/* Tag Input Styles */
.input-group {
    position: relative;
    z-index: 10;
}

.tags-input-container {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    cursor: text;
    position: relative;
    z-index: 20;
}

.tags-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.1);
}

.tag {
    background: #E0E7FF;
    color: #4338CA;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease;
}

.tag-remove {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 0.8;
    color: #4338CA;
    opacity: 0.6;
}

.tag-remove:hover {
    opacity: 1;
}

.tags-input {
    border: none;
    outline: none;
    padding: 6px;
    flex-grow: 1;
    font-family: inherit;
    font-size: 1rem;
    min-width: 150px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Meeting Insights Dashboard --- */
.minutes-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-box {
    background: linear-gradient(to right, #fdfbfb, #ebedee);
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 15px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Action Cards Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.action-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.ac-assignee {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 5px;
}

.ac-task {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

/* Key Points List */
.kp-list {
    list-style: none;
    padding: 0;
}

.kp-list li {
    background: #f3f4f6;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
}

.kp-list li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* --- Top Navigation (Profile & Logout) --- */
.top-nav {
    position: absolute;
    /* Relative to app-container */
    top: 25px;
    right: 35px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-color);
    /* Solid yellow for visibility */
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--primary-color);
    /* Purple text on yellow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    /* Yellow avatar */
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.history-link {
    background: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    border: 2px solid white;
}

.history-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.logout-link {
    color: white;
    background: #ef4444;
    /* Red logout button */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.logout-link:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

[contenteditable="true"] {
    position: relative;
    outline: none;
    transition: all 0.2s;
}

[contenteditable="true"]:hover {
    background: rgba(109, 40, 217, 0.03);
    cursor: text;
}

[contenteditable="true"]:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--primary-color);
    border-radius: 4px;
}

.edit-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Login Page Styles --- */
.login-body {
    background: var(--bg-light);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.login-logo-img {
    width: 200px;
    margin: 0 auto 20px auto;
    display: block;
}

.login-card h2 {
    color: var(--text-dark);
    margin-bottom: 30px;
    font-weight: 700;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    text-align: left;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4B5563;
    font-size: 0.9rem;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1);
}

.login-error {
    color: #DC2626;
    background: #FEF2F2;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: none;
}