:root {
    --primary: #4caf50;
    --secondary: #2196f3;
    --accent: #ff9800;
    --ai-color: #9c27b0;
    --success: #8bc34a;
    --warning: #ffc107;
    --danger: #f44336;
    --light: #f1f8e9;
    --dark: #2e7d32;
    --dark-blue: #1976d2;
    --gray: #757575;
    --light-gray: #f5f5f5;
    --border: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

header {
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    padding: 30px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Collaboration Panel */
.collaboration-panel {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--secondary);
    display: none;
}

.collaboration-panel.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.online-users {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.user-badge {
    background: var(--secondary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.chat-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.chat-messages {
    height: 150px;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.chat-input {
    display: flex;
    border-top: 1px solid var(--border);
}

.chat-input input {
    flex: 1;
    border: none;
    padding: 12px;
    outline: none;
}

.chat-input button {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
}

/* Form Styles */
.form-section {
    margin-bottom: 30px;
    background: var(--light-gray);
    padding: 25px;
    border-radius: 15px;
}

.form-title {
    color: var(--dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-title::before {
    content: '📋';
    font-size: 1.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

select, input, textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.grade-select {
    background-color: var(--light);
    font-weight: bold;
    color: var(--dark);
}

.language-select {
    background-color: var(--light);
}

.time-optimizer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.time-status {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Activities Section */
.activities-container {
    margin-bottom: 30px;
}

.activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.activity-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.activities-list {
    display: grid;
    gap: 15px;
}

.activity-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 6px solid var(--accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.activity-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.activity-title {
    font-weight: bold;
    color: var(--dark);
    font-size: 1.1rem;
    flex: 1;
}

.activity-time {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.activity-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.activity-actions-inline {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark), var(--primary));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--dark-blue));
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--dark-blue), var(--secondary));
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: white;
}

.btn-ai {
    background: linear-gradient(135deg, var(--ai-color), #6a1b9a);
    color: white;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #6a1b9a, var(--ai-color));
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 40px;
}

/* Preview Section */
.preview-section {
    margin-top: 40px;
    border-top: 3px dashed #ddd;
    padding-top: 30px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-title {
    color: var(--dark);
    margin-bottom: 0;
    font-size: 1.5rem;
}

.preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.roster-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid var(--border);
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.roster-table th {
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.roster-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s;
}

.roster-table tr:hover td {
    background-color: var(--light);
}

.roster-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: var(--danger);
}

.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.export-option h4 {
    margin-bottom: 15px;
    color: var(--dark);
}

.export-option .btn {
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ai-suggestions {
    margin-top: 20px;
}

.ai-suggestion {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-suggestion:hover {
    background: var(--light-gray);
    border-color: var(--ai-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .activities-header,
    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark);
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-online {
    background: var(--success);
}

.status-offline {
    background: var(--gray);
}

.status-busy {
    background: var(--warning);
}