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

:root {
    --primary-color: #FF9933;
    --secondary-color: #FFFFFF;
    --accent-color: #138808;
    --dark-color: #000080;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    min-height: 100vh;
}

/* Background for auth pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px);
    pointer-events: none;
}

/* Dashboard background */
.dashboard-page, .admin-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
}

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

/* Auth Box */
.auth-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 5px;
}

.logo p {
    color: var(--text-light);
    font-size: 0.9em;
}

.auth-form h2 {
    color: var(--dark-color);
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85em;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #e6892a;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--dark-color);
    color: white;
}

.btn-secondary:hover {
    background: #000066;
}

.btn-edit {
    background: var(--accent-color);
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-edit:hover {
    background: #0d6b07;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    margin: 5px 0;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #ffebee;
    color: var(--error-color);
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background: #e8f5e9;
    color: var(--success-color);
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
}

.success-message.show {
    display: block;
}

.info-text {
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.social-icon {
    font-size: 1.2em;
}

.existing-files {
    margin-top: 10px;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.8em;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dashboard */
.welcome-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.service-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.service-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.service-card h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.service-card p {
    color: var(--text-light);
}

.service-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.btn-close:hover {
    color: var(--error-color);
}

.hidden {
    display: none !important;
}

.uploaded-files {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.uploaded-file {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-requests {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.requests-list {
    margin-top: 20px;
}

.user-chat-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.user-chat-section h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
}

.user-chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.user-chat-panel .chat-messages {
    min-height: 300px;
    max-height: 400px;
}

.request-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.request-item h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.request-item .request-meta {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.request-item .request-text {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

/* Admin Dashboard */
.admin-header {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.admin-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
}

.users-panel {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.users-list {
    margin-top: 15px;
}

.user-item {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.user-item:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.user-item.active {
    background: var(--primary-color);
    color: white;
}

.user-item h4 {
    margin-bottom: 5px;
}

.user-item .user-email {
    font-size: 0.85em;
    opacity: 0.8;
}

.user-item .user-services {
    font-size: 0.85em;
    margin-top: 5px;
}

.chat-panel {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.chat-header {
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.user-service-requests {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    min-height: 200px;
    max-height: calc(100vh - 500px);
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    max-width: 80%;
}

.message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.admin {
    background: white;
    border: 2px solid var(--border-color);
    margin-right: auto;
}

.message-meta {
    font-size: 0.75em;
    opacity: 0.7;
    margin-bottom: 5px;
}

.chat-input-container {
    border-top: 2px solid var(--border-color);
    padding-top: 15px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
}

.chat-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--error-color);
}

.user-service-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
}

.user-service-item h5 {
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    background: #f5f5f5;
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

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

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.admin-tab-content {
    margin-top: 0;
}

#credentialsTab.admin-tab-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Credentials Section */
.credentials-section {
    width: 100%;
}

.credentials-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.credential-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.credential-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.credential-item.admin-credential {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: var(--primary-color);
}

.credential-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.credential-header h4 {
    color: var(--dark-color);
    margin: 0;
}

.credential-form {
    display: grid;
    gap: 15px;
}

.credential-form .form-group {
    margin-bottom: 0;
}

.credential-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9em;
}

.credential-input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.credential-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-delete {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #d32f2f;
}

.btn-download {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-download:hover {
    background: #0d6b07;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-box {
        padding: 30px 20px;
    }

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .users-panel {
        max-height: 300px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-form input {
        width: 100%;
    }

    .message {
        max-width: 90%;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .credential-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .credential-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 2em;
    }

    .container {
        padding: 15px;
    }

    .welcome-section,
    .service-form,
    .user-requests {
        padding: 20px;
    }
    
    .social-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .social-link {
        justify-content: center;
    }
}
