/* css/styles.css - Main stylesheet for Gain28-V2 Portal */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a237e;
    --secondary-color: #3949ab;
    --accent-color: #ffd700;
    --diamond-color: #b9f2ff;
    --crown-color: #ffd700;
    --admin-color: #ff6b6b;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

.login-box h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2em;
}

.login-box h2 {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.2em;
    font-weight: normal;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.login-box button {
    width: 100%;
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-box button:hover {
    background: var(--primary-color);
}

.error-message {
    color: #d32f2f;
    margin-top: 15px;
    font-size: 14px;
}

/* Header Styles */
.main-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
}

.header-content h1 {
    font-size: 1.5em;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-type {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.user-type.diamond {
    background: var(--diamond-color);
    color: var(--primary-color);
}

.user-type.crown-jewel {
    background: var(--crown-color);
    color: var(--primary-color);
}

.user-type.admin {
    background: var(--admin-color);
    color: white;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid white;
    border-radius: 5px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: white;
    color: var(--primary-color);
}

/* Navigation Styles */
.main-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav ul {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--secondary-color);
}

.nav-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

/* Content Sections */
.content-area {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.content-section {
    display: none;
}

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

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* Sidebar */
.sidebar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.updates-widget h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.updates-list {
    font-size: 14px;
}

.update-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.update-item:last-child {
    border-bottom: none;
}

.update-date {
    color: #666;
    font-size: 12px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-color);
}

.btn-secondary {
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

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

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-card {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.admin-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-card p {
    margin-bottom: 15px;
    color: #666;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        top: 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        padding: 0;
    }
    
    .nav-link {
        flex: 1 1 50%;
        justify-content: center;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .nav-link {
        flex: 1 1 100%;
        padding: 12px;
    }
    
    .content-area {
        padding: 20px;
    }
}

/* Add these styles to the existing css/styles.css file */

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

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

select.form-control {
    cursor: pointer;
}

input[type="file"].form-control {
    padding: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #4caf50;
    color: white;
}

.notification-error {
    background: #f44336;
    color: white;
}

.notification-info {
    background: var(--secondary-color);
    color: white;
}

/* Manual Content Styles */
.manual-section {
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.manual-section h3 {
    background: var(--bg-color);
    padding: 15px 20px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    user-select: none;
}

.manual-section h3:hover {
    background: #e8e8e8;
}

.manual-section h3::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
}

.manual-section h3.collapsed::after {
    transform: rotate(-90deg);
}

.manual-section-content {
    padding: 20px;
    background: white;
}

.manual-section h4 {
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.manual-section code {
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.manual-section pre {
    background: #f8f8f8;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

/* Downloads Section Styles */
.downloads-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.download-category {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.download-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.download-item:hover {
    background: #e8e8e8;
}

.download-info {
    flex: 1;
}

.download-info h4 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.download-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.download-link {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.download-link:hover {
    background: var(--primary-color);
}

/* Blog Post Styles */
.blog-posts {
    margin-top: 20px;
}

.blog-post {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
}

.blog-post h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.blog-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.blog-content {
    line-height: 1.8;
    color: var(--text-color);
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

/* Access Restricted Message */
.access-restricted {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px 20px;
    border-radius: 5px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.access-restricted i {
    font-size: 20px;
}

/* Responsive Modal */
@media (max-width: 600px) {
    .modal {
        max-width: 100%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

/* Loading Spinner */
.loading {
    position: relative;
    color: #999;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: 10px auto;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s linear infinite;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

/* Error Message */
.error {
    color: #d32f2f;
    text-align: center;
    padding: 20px;
}

/* Success Message */
.success {
    color: #388e3c;
    text-align: center;
    padding: 20px;
}
/* Version styles */
.download-item.current-version {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #4caf50;
    color: white;
}

.crown-badge {
    color: var(--crown-color);
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
}

.version-history {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.version-history h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-item {
    background: white;
    margin-bottom: 12px;
}

.release-notes-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.release-notes-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.release-notes {
    margin: 15px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 5px;
    border-left: 4px solid var(--secondary-color);
}

.release-notes h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
}

.release-notes pre {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
}

/* Update widget styling */
.update-item {
    margin-bottom: 20px;
}

.update-message {
    line-height: 1.6;
}

.update-message p {
    margin: 10px 0;
}

.update-message ol,
.update-message ul {
    margin: 15px 0;
    padding-left: 25px;
}

.update-message li {
    margin-bottom: 8px;
}

.update-message strong {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
}