/* KilnAVP - Main Stylesheet */
/* Keep all styling external and modular for easy adjustments */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Admin Authentication Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-modal {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header .main-title {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.auth-header .subtitle {
    color: #e74c3c;
    font-weight: 500;
    font-size: 0.8rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-form .input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-form input[type="password"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-error {
    background: #fee;
    color: #e74c3c;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #fcc;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.auth-footer {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #764ba2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    text-align: center;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.main-title {
    font-size: 6.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 300;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    max-width: 400px;
    margin: 0 auto;
    white-space: nowrap;
}

/* Login Section */
.login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.client-access {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.client-access h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

/* Form Styles */
.access-form, #addClientForm, #uploadModelForm, #adminPasswordForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.input-group input, .input-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Button Styles */
.access-btn, .action-btn, .submit-btn, .admin-submit-btn {
    padding: 15px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.access-btn:hover, .action-btn:hover, .submit-btn:hover, .admin-submit-btn:hover {
    background-color: #2980b9;
}

.admin-link, .back-btn {
    color: #7f8c8d;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.admin-link:hover, .back-btn:hover {
    color: #2c3e50;
    border-color: #2c3e50;
}



/* Modal Footer Links */
.modal-footer-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.modal-footer-links p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.resource-modal-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.resource-modal-link:hover {
    color: #5a6fd8;
}

.resource-modal-link i {
    margin-right: 5px;
}

/* Admin Panel Styles */
.admin-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    justify-content: center;
}

.admin-actions .action-btn,
.admin-actions .back-btn {
    flex: 1;
    max-width: 200px;
    min-width: 150px;
    text-align: center;
    white-space: nowrap;
}

.search-section {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.clients-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.client-block {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.client-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.client-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.delete-client-btn, .delete-project-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.delete-client-btn:hover, .delete-project-btn:hover {
    background-color: #c0392b;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.project-info h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.project-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.launch-btn, .setup-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.launch-btn {
    background-color: #27ae60;
    color: white;
}

.launch-btn:hover {
    background-color: #219a52;
}

.setup-btn {
    background-color: #f39c12;
    color: white;
}

.setup-btn:hover {
    background-color: #e67e22;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .project-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Footer Links */
.footer-links {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Resource Management Modal */
.resource-modal {
    max-width: 600px;
    width: 95%;
}

.product-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.clear-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.clear-btn:hover {
    background: #5a6268;
}

.added-products {
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5rem;
}

.added-products h4 {
    color: #333;
    margin-bottom: 1rem;
}

.recent-products-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.recent-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #333;
}

.product-details {
    font-size: 0.85rem;
    color: #666;
}

.no-products {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Admin Messages */
.admin-message {
    display: none;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.admin-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admin-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Model Upload Styling */
.file-info {
    margin-top: 8px;
}

.file-info small {
    color: #666;
    font-size: 0.85rem;
}

.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.file-preview .file-name {
    font-weight: 500;
    color: #28a745;
}

.file-preview .file-size {
    margin-left: 10px;
    color: #666;
    font-size: 0.9rem;
}

.upload-progress {
    margin: 20px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}

/* Model upload button states */
.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.submit-btn.uploading {
    background: #ffc107;
    color: #212529;
}

/* Model Management Interface */
.models-section, .deleted-models-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.deleted-models-section {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.model-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.model-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.model-card.deleted {
    background: #fff5f5;
    border-color: #f5c6cb;
    opacity: 0.8;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.model-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.model-category {
    background: #007bff;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.model-category.deleted {
    background: #dc3545;
}

.model-details {
    margin: 10px 0;
}

.model-details p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #666;
}

.model-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.view-btn {
    background: #28a745;
    color: white;
}

.view-btn:hover {
    background: #218838;
}

.delete-model-btn {
    background: #ffc107;
    color: #212529;
}

.delete-model-btn:hover {
    background: #e0a800;
}

.permanent-delete-btn {
    background: #dc3545;
    color: white;
}

.permanent-delete-btn:hover {
    background: #c82333;
}

.recover-model-btn {
    background: #17a2b8;
    color: white;
}

.recover-model-btn:hover {
    background: #138496;
}

.no-recovery {
    color: #6c757d;
    font-style: italic;
    font-size: 0.8rem;
    align-self: center;
}

/* Large Modal for Model Management */
.large-modal {
    max-width: 90vw;
    width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Model Stats Cards */
.model-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}