/* Custom styles for IFHE Campus Assistant Portal */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom gradient backgrounds */
.bg-ifhe-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Section visibility */
.section-page {
    display: block;
}

.section-page.hidden {
    display: none;
}

/* Navigation active states */
.nav-link {
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-link.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb;
}

.mobile-nav-link.active {
    background-color: #eff6ff;
    color: #2563eb !important;
}

/* Chat messages */
.chat-message {
    animation: fadeInUp 0.3s ease-out;
}

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

.user-message {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    margin-left: auto;
    max-width: 80%;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    word-wrap: break-word;
}

.bot-message {
    background: #f3f4f6;
    color: #374151;
    margin-right: auto;
    max-width: 85%;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    word-wrap: break-word;
}

.bot-message a {
    color: #2563eb;
    text-decoration: underline;
}

.bot-message a:hover {
    color: #1d4ed8;
}

.bot-message ul {
    margin: 8px 0;
    padding-left: 20px;
}

.bot-message li {
    margin: 4px 0;
}

.bot-message code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Event cards */
.event-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.event-date {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

/* Notice cards */
.notice-card {
    transition: all 0.3s ease;
    border-left: 4px solid #e5e7eb;
}

.notice-card:hover {
    border-left-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notice-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-academic { background: #dbeafe; color: #1e40af; }
.category-events { background: #dcfce7; color: #166534; }
.category-general { background: #f3f4f6; color: #374151; }
.category-placements { background: #fef3c7; color: #92400e; }
.category-urgent { background: #fee2e2; color: #dc2626; }

/* Filter buttons */
.filter-btn {
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: #2563eb !important;
    color: white !important;
}

/* Toast notifications */
.toast {
    min-width: 300px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.warning { background: #f59e0b; }
.toast.info { background: #3b82f6; }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading states */
.loading-button {
    position: relative;
    color: transparent !important;
}

.loading-button::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form styles */
.form-input {
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Registration form */
.registration-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 16px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.registration-form.open {
    max-height: 600px;
}

/* Admin panel styles */
.admin-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.admin-stat {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.admin-table {
    overflow-x: auto;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

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

.admin-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Responsive design */
@media (max-width: 768px) {
    .user-message,
    .bot-message {
        max-width: 90%;
    }
    
    .toast {
        min-width: 250px;
    }
    
    .admin-table {
        font-size: 0.875rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .bot-message {
        background: #374151;
        color: #f9fafb;
    }
    
    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .admin-card {
        background: #1f2937;
        color: #f9fafb;
    }
}

/* Print styles */
@media print {
    .section-page:not(#chat) {
        display: block !important;
    }
    
    .section-page#chat {
        display: none !important;
    }
    
    nav,
    .filter-btn,
    button {
        display: none !important;
    }
}