/* OpenDreams Portal - Purdue University Inspired Design */
/* Enhanced Mobile Responsiveness */

:root {
    --primary: #ceb888;
    --primary-dark: #b89a6a;
    --secondary: #2c3e50;
    --accent: #e67e22;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --border: #e0e0e0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.1);
    
    /* Mobile-specific variables */
    --mobile-padding: 1rem;
    --mobile-card-padding: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f5f5f5;
    overflow-x: hidden;
    width: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Typography - Mobile optimized */
h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1rem;
    word-break: break-word;
}

h2 {
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--secondary);
    word-break: break-word;
}

h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    word-break: break-word;
}

/* Buttons - Touch-friendly */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    min-height: 44px; /* Minimum touch target size */
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: var(--secondary);
}

.btn-primary:hover, 
.btn-primary:active {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--secondary);
}

.btn-secondary:hover,
.btn-secondary:active {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-small {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    min-height: 38px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover,
.btn-danger:active {
    background: #c0392b;
}

/* Forms - Mobile optimized */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(206, 184, 136, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-size: 0.95rem;
    word-break: break-word;
}

.alert-success {
    background: #d4edda;
    border-left-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-left-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left-color: var(--info);
    color: #0c5460;
}

/* Cards - Mobile optimized */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    word-break: break-word;
    overflow-wrap: break-word;
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Authentication Container - Mobile first */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, #1a2632 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1.5rem;
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.2s;
    min-height: 44px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.admin-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.admin-link a {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    padding: 0.5rem;
}

/* App Layout - Mobile first */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar - Mobile optimized */
.sidebar {
    width: 100%;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.logo {
    margin-bottom: 0.75rem;
    text-align: center;
}

.logo img {
    max-width: 100px;
    height: auto;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    color: var(--gray);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

.sidebar-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem;
    gap: 0.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
    height: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--border);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--primary);
}

.sidebar-nav a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
    border-radius: 8px;
    min-height: 40px;
}

.sidebar-nav a:hover,
.sidebar-nav a:active {
    background: var(--light);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--light);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Main Content - Mobile optimized */
.main-content {
    flex: 1;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.content-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.content-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    word-break: break-word;
}

/* Status Badges */
.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.status-ready {
    background: #d4edda;
    color: #155724;
}

.status-review {
    background: #fff3cd;
    color: #856404;
}

.status-weak {
    background: #f8d7da;
    color: #721c24;
}

.status-incomplete {
    background: #e2e3e5;
    color: #383d41;
}

/* Checklist - Mobile optimized */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
    background: white;
}

.checklist-item:hover,
.checklist-item:active {
    background: var(--light);
    transform: translateX(4px);
}

.checklist-item.completed {
    background: #f8f9fa;
    border-left: 3px solid var(--success);
}

.checklist-icon {
    font-size: 1.25rem;
    font-weight: bold;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.checklist-info {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

.checklist-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    word-break: break-word;
}

.required-badge {
    background: var(--danger);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    white-space: nowrap;
    display: inline-block;
}

.checklist-meta {
    font-size: 0.75rem;
    color: var(--gray);
    word-break: break-word;
}

.checklist-action {
    width: 100%;
    margin-top: 0.5rem;
}

.checklist-action .btn-small {
    width: 100%;
}

/* Score Badges */
.score-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.score-strong {
    background: #d4edda;
    color: #155724;
}

.score-good {
    background: #fff3cd;
    color: #856404;
}

.score-weak {
    background: #f8d7da;
    color: #721c24;
}

.score-very-weak {
    background: #f8d7da;
    color: #c0392b;
    font-weight: bold;
}

.score-pending {
    background: #e2e3e5;
    color: #383d41;
}

/* Admin Tables - Mobile optimized */
.admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.admin-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
}

.admin-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.8rem;
}

.admin-table tr:hover {
    background: var(--light);
}

/* File Viewer - Mobile optimized */
.file-viewer {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.file-viewer iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.score-display {
    background: var(--light);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: inline-block;
    width: 100%;
}

.score-number {
    font-size: 1.75rem;
    font-weight: bold;
    display: inline-block;
    margin-left: 0.5rem;
}

/* Upload Area - Touch friendly */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:active {
    border-color: var(--primary);
    background: var(--light);
}

.upload-area input {
    display: none;
}

.upload-label {
    cursor: pointer;
    display: inline-block;
}

.upload-label p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Document Types Grid - Mobile optimized */
.document-types-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.document-type-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
}

.document-type-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.document-type-card.uploaded {
    border-left: 3px solid var(--success);
    background: #f8f9fa;
}

.document-status {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0.5rem 0;
}

/* Review Sections */
.review-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.warning-box,
.success-box,
.info-box {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.9rem;
    word-break: break-word;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
}

.success-box {
    background: #d4edda;
    border-left: 4px solid #27ae60;
}

.info-box {
    background: #d1ecf1;
    border-left: 4px solid #3498db;
}

/* Declaration */
.declaration {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

.declaration label {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
}

.declaration input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.declaration span {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Button Groups */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.button-group .btn {
    width: 100%;
}

.navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.navigation-buttons .btn {
    width: 100%;
}

/* Student Info Grid */
.student-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.student-info-grid > div {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

/* File Meta - Mobile optimized */
.file-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.file-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-meta-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-meta-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary);
    word-break: break-word;
    text-align: right;
}

/* Score Card */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: center;
}

/* Rec Score Display */
.rec-score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: center;
}

.rec-score-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

/* Stats */
.stats {
    width: 100%;
}

.stat-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--light);
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .checklist-item, .document-type-card {
    animation: fadeIn 0.3s ease-out;
}

/* Tablet Breakpoint */
@media (min-width: 768px) {
    /* App Layout - Tablet/Desktop */
    .app {
        flex-direction: row;
    }
    
    /* Sidebar - Desktop */
    .sidebar {
        width: 280px;
        position: sticky;
        top: 0;
        height: 100vh;
        border-right: 1px solid var(--border);
        border-bottom: none;
        overflow-y: auto;
    }
    
    .sidebar-nav {
        flex-direction: column;
        overflow-x: visible;
        padding: 1rem 0;
    }
    
    .sidebar-nav a {
        white-space: normal;
        border-radius: 0;
        padding: 0.75rem 1.5rem;
    }
    
    .sidebar-nav a.active {
        border-left: 3px solid var(--primary);
        border-bottom: none;
        background: var(--light);
    }
    
    /* Main Content */
    .main-content {
        padding: 2rem;
    }
    
    .content-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Checklist - Desktop */
    .checklist-item {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .checklist-action {
        width: auto;
        margin-top: 0;
    }
    
    .checklist-action .btn-small {
        width: auto;
    }
    
    /* Button Groups - Desktop */
    .button-group {
        flex-direction: row;
    }
    
    .button-group .btn {
        width: auto;
    }
    
    .navigation-buttons {
        flex-direction: row;
    }
    
    .navigation-buttons .btn {
        width: auto;
    }
    
    /* Document Types Grid - Tablet */
    .document-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Student Info Grid - Desktop */
    .student-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .student-info-grid > div {
        border-bottom: none;
    }
    
    /* File Meta - Desktop */
    .file-meta {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .file-meta-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-meta-value {
        text-align: left;
    }
    
    /* Declaration */
    .declaration label {
        flex-direction: row;
        align-items: flex-start;
    }
    
    /* Stats */
    .stats {
        width: auto;
    }
}

/* Large Desktop Breakpoint */
@media (min-width: 1024px) {
    .document-types-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .main-content {
        padding: 2rem;
        max-width: calc(100% - 280px);
    }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 767px) {
    /* Increase touch targets */
    .btn, 
    .sidebar-nav a,
    .tab-btn,
    .checklist-action .btn,
    .admin-table .btn {
        min-height: 44px;
    }
    
    /* Better spacing for touch */
    .form-group input,
    .form-group select {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Make tables scrollable */
    .admin-table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    /* Adjust font sizes */
    body {
        font-size: 16px;
    }
    
    /* Better card spacing */
    .card {
        padding: 1rem;
    }
    
    /* Stack badges */
    .content-header .status-badge {
        align-self: flex-start;
    }
    
    /* Improve upload area */
    .upload-area {
        padding: 2rem 1rem;
    }
    
    /* Make score display readable */
    .score-number {
        font-size: 1.5rem;
    }
    
    /* PDF viewer height */
    .file-viewer iframe {
        height: 400px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --mobile-padding: 0.75rem;
        --mobile-card-padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.35rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .auth-card {
        padding: 1.25rem;
    }
    
    .sidebar-header {
        padding: 0.75rem;
    }
    
    .logo img {
        max-width: 80px;
    }
    
    .checklist-title {
        font-size: 0.9rem;
    }
    
    .required-badge {
        font-size: 0.6rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .file-viewer iframe {
        height: 300px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        position: sticky;
    }
    
    .sidebar-nav {
        padding: 0.25rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .file-viewer iframe {
        height: 300px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .btn,
    .navigation-buttons,
    .admin-link {
        display: none;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}