/* IFUCAN - Modern, Responsive, Fun UI */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    direction: ltr;
}

body[dir="rtl"] {
    direction: rtl;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    width: 80px;
    height: 80px;
}

.loader svg {
    width: 100%;
    height: 100%;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* Header */
.app-header {
    background: var(--surface);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 70px;
    right: 1rem;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-lg);
    padding: 0.5rem;
    z-index: 200;
    min-width: 150px;
}

.dropdown-menu button {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.dropdown-menu button:hover {
    background: var(--bg);
}

/* Main Content */
.main-content {
    flex: 1;
    padding-bottom: 80px;
    position: relative;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-header {
    padding: 1rem;
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.screen-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Auth Screen */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow-lg);
    text-align: center;
}

.auth-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-container h2 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.auth-container p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.otp-section {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group i {
    color: var(--text-light);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Search Container */
.search-container {
    padding: 1rem;
    background: var(--surface);
    box-shadow: 0 2px 4px var(--shadow);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border: 2px solid var(--border);
}

.search-box i {
    color: var(--text-light);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
}

/* Categories */
.categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.category-btn.active,
.category-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Requests List */
.requests-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.request-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-lg);
    border-color: var(--primary);
}

.request-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.request-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.request-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.request-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.request-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.request-price {
    font-weight: 700;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.request-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.request-meta i {
    margin-right: 0.25rem;
}

/* Request Detail */
.request-detail {
    padding: 1rem;
}

.detail-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.solutions-section {
    margin-top: 2rem;
}

.solution-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.solution-card:hover {
    border-color: var(--primary);
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.solution-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.solution-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.solution-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.solution-link {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
}

.solution-link:hover {
    text-decoration: underline;
}

.solution-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Form Container */
.form-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 100px;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--shadow-lg);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    box-shadow: 0 -2px 10px var(--shadow);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
}

/* Admin Panel */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: var(--bg);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.admin-content {
    padding: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .request-card {
        padding: 1rem;
    }
}

/* RTL Support */
[dir="rtl"] .input-group i {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .fab {
    right: auto;
    left: 1.5rem;
}

[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 1rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    opacity: 0.5;
}

/* Chatbot Widget */
.chatbot-widget {
    margin-top: 2rem;
    background: var(--bg);
    border-radius: 16px;
    border: 2px solid var(--border);
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.chatbot-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 250px;
}

.chatbot-message {
    display: flex;
    gap: 0.75rem;
    align-items: start;
}

.chatbot-message.bot {
    flex-direction: row;
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message i {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.chatbot-message.user i {
    color: var(--success);
}

.chatbot-message p {
    background: var(--surface);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin: 0;
    box-shadow: 0 2px 4px var(--shadow);
    max-width: 80%;
}

.chatbot-message.user p {
    background: var(--primary);
    color: white;
}

.chatbot-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 2px solid var(--border);
    background: var(--surface);
}

.chatbot-input input {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input input:focus {
    border-color: var(--primary);
}

