/* Adaptive Full-Screen Design for Legal AI Service */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
}

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

html, body {
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
}

/* Main Layout - Full Screen */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Fixed Height */
.header {
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credits-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--gray-200);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--gray-100);
}

/* Main Content - Scrollable Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Cards Container */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
    max-height: calc(100vh - 100px);
}

/* Glass Card Style */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 1.1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    flex: 1;
    overflow-y: auto;
}

/* Form Elements */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: none;
    min-height: 80px;
}

/* Document Type Selection */
.doc-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.doc-type-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-type-item:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.doc-type-item input[type="checkbox"] {
    width: auto;
}

.doc-type-item label {
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
}

/* File Upload */
.upload-zone {
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.upload-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-zone p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.upload-zone .hint {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 8px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-block {
    width: 100%;
}

/* Documents List */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 10px;
    transition: all 0.2s;
}

.doc-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    font-size: 1.5rem;
}

.doc-details h4 {
    font-size: 0.9rem;
    color: var(--gray-800);
}

.doc-details p {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.doc-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-processing {
    background: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.step {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.step.active {
    color: var(--primary);
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Login/Register Pages */
.auth-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
    color: var(--gray-800);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive Design */

/* Large screens (1200px+) */
@media (min-width: 1200px) {
    .content-grid {
        gap: 24px;
        padding: 0 20px;
    }
    
    .glass-card {
        padding: 28px;
    }
}

/* Medium screens (768px - 1199px) */
@media (max-width: 1199px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .glass-card {
        max-height: calc(50vh - 60px);
    }
}

/* Tablets and small laptops */
@media (max-width: 991px) {
    .header {
        padding: 0 16px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .nav-links a span {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    html, body {
        overflow: auto;
    }
    
    .app-container {
        height: auto;
        min-height: 100vh;
    }
    
    .header {
        height: 56px;
        padding: 0 12px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        height: auto;
    }
    
    .glass-card {
        padding: 16px;
        max-height: none;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }
    
    .doc-types {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .upload-zone {
        padding: 20px;
    }
    
    .btn {
        padding: 14px 20px;
    }
    
    .auth-card {
        padding: 24px;
        margin: 12px;
    }
    
    .modal {
        padding: 20px;
        margin: 12px;
        max-height: 85vh;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    .header {
        height: 52px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .credits-badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .glass-card {
        padding: 14px;
        border-radius: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        height: auto;
        min-height: 100vh;
    }
    
    .content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .glass-card {
        max-height: none;
    }
    
    .header {
        height: 50px;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    animation: fadeIn 0.3s ease-out;
}
