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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-user span {
    font-weight: 500;
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .nav-brand {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

@media (max-width: 480px) {
    .btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
}

/* Cards */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card, .stat-card, .status-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.feature-card p {
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.6;
}

.subscription-status {
    margin-bottom: 2rem;
}

.status-card {
    max-width: 600px;
    margin: 0 auto;
}

.status-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.status-card p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card, .stat-card, .status-card {
        padding: 1.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .feature-card, .stat-card, .status-card {
        padding: 1.25rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

@media (max-width: 480px) {
    .form-group input, 
    .form-group textarea, 
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Auth Page */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-card h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.auth-card h2 {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.auth-toggle {
    text-align: center;
    margin-top: 1rem;
}

.auth-toggle a {
    color: #3498db;
    text-decoration: none;
}

/* Messages */
.error-message {
    color: #e74c3c;
    padding: 0.5rem;
    margin: 1rem 0;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
    background: #fadbd8;
}

.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}

/* Tables */
.admin-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.admin-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    min-width: 600px;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.data-table td {
    font-size: 0.95rem;
}

.data-table button {
    margin: 0.25rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .admin-section {
        padding: 1rem;
    }
    
    .data-table th, .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .data-table button {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 900px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.close:hover {
    color: #000;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .modal-large {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
    }
}

/* Search */
.search-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#searchResults {
    margin-top: 2rem;
}

#searchResults h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .search-section {
        padding: 1.5rem;
    }
    
    .search-section h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
}

/* Grids */
.resources-grid, .tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.resource-card, .test-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.resource-card h3, .resource-card h4,
.test-card h3, .test-card h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.resource-card p, .test-card p {
    color: #555;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.resource-card:hover, .test-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resource-card .btn, .test-card .btn {
    margin-top: auto;
}

@media (max-width: 768px) {
    .resources-grid, .tests-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .resources-grid, .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-card, .test-card {
        padding: 1.25rem;
    }
}

/* AI Chat */
.ai-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.chat-box {
    height: 500px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    background: #fafafa;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
}

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

.chat-message strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.chat-message.user {
    background: #e3f2fd;
    margin-left: 15%;
    border-left: 4px solid #2196f3;
}

.chat-message.ai {
    background: #f5f5f5;
    margin-right: 15%;
    border-left: 4px solid #4caf50;
}

.chat-input-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-container textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    min-height: 60px;
}

.chat-input-container button {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ai-container {
        padding: 1rem;
    }
    
    .chat-box {
        height: 400px;
    }
    
    .chat-message.user {
        margin-left: 10%;
    }
    
    .chat-message.ai {
        margin-right: 10%;
    }
}

@media (max-width: 480px) {
    .chat-box {
        height: 350px;
        padding: 0.75rem;
    }
    
    .chat-message {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .chat-message.user {
        margin-left: 5%;
    }
    
    .chat-message.ai {
        margin-right: 5%;
    }
    
    .chat-input-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chat-input-container button {
        width: 100%;
    }
}

/* Tabs */
.upload-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
}

.tab-btn:hover {
    background: #d5dbdb;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.question-item {
    background: #f8f9fa;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.question-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .tab-content {
        padding: 1.5rem;
    }
    
    .question-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .upload-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .tab-content {
        padding: 1rem;
    }
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filters input, .filters select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters select {
    min-width: 150px;
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }
    
    .filters input, .filters select {
        width: 100%;
    }
    
    .filters button {
        width: 100%;
    }
}

/* Meeting Transcription Styles */
.meeting-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-indicator {
    font-size: 14px;
    font-weight: bold;
}

.status-indicator.recording {
    color: #e74c3c;
}

.status-indicator.paused {
    color: #f39c12;
}

.status-indicator.stopped {
    color: #95a5a6;
}

.meeting-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.transcript-panel, .summary-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.transcript-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
    border-radius: 4px;
}

.transcript-entry {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-left: 3px solid #3498db;
    border-radius: 4px;
}

.transcript-entry .timestamp {
    color: #7f8c8d;
    font-size: 12px;
    margin-right: 10px;
}

.transcript-entry .speaker {
    font-weight: bold;
    color: #2c3e50;
    margin-right: 8px;
}

.transcript-entry .text {
    color: #34495e;
}

.summary-section {
    margin-bottom: 20px;
}

.action-items-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.action-items-table th,
.action-items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.action-items-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.action-items-table .editable {
    background: #fff9e6;
    cursor: text;
}

.action-items-table .editable:focus {
    outline: 2px solid #3498db;
    background: white;
}

.sync-controls {
    margin-top: 30px;
    padding: 20px;
    background: #ecf0f1;
    border-radius: 8px;
}

.sync-controls h3 {
    margin-bottom: 15px;
}

.sync-controls label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.meeting-history {
    margin-top: 40px;
}

.meeting-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meeting-card h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .meeting-layout {
        grid-template-columns: 1fr;
    }
    
    .meeting-controls {
        flex-wrap: wrap;
    }
}
