/* setting.css - Setting Panel Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a5f7a, #159895);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* Header Styles */
.header {
    background: linear-gradient(to right, #002b5b, #1a5f7a);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header p {
    opacity: 0.9;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

/* Main Content Layout */
.main-content {
    display: flex;
    min-height: 600px;
}

/* Records Sidebar */
.records-sidebar {
    width: 35%;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 20px;
    overflow-y: auto;
    max-height: 700px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #159895;
}

.sidebar-header h2 {
    color: #002b5b;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-new-btn {
    background: #159895;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.add-new-btn:hover {
    background: #127a77;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 152, 149, 0.2);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.record-item:hover {
    border-color: #159895;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.record-item.active {
    border-color: #159895;
    background: #e3f4f4;
    box-shadow: 0 3px 15px rgba(21, 152, 149, 0.2);
}

.record-title {
    font-weight: bold;
    color: #002b5b;
    margin-bottom: 5px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.record-type {
    background: #e3f4f4;
    color: #159895;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Form Section */
.form-section {
    width: 65%;
    padding: 30px;
    overflow-y: auto;
    max-height: 700px;
}

.form-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #159895;
}

.form-header h2 {
    color: #002b5b;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group.full-width {
    grid-column: span 2;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #002b5b;
    display: flex;
    align-items: center;
    gap: 8px;
}

input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #159895;
    box-shadow: 0 0 0 3px rgba(21, 152, 149, 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.threshold-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.threshold-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.threshold-item label {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.threshold-item input {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.form-actions {
    grid-column: span 2;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-btn {
    background: linear-gradient(135deg, #159895, #1a5f7a);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(135deg, #127a77, #002b5b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 152, 149, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff7b7b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.cancel-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-2px);
}

/* Status Messages */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

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

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* No Records Message */
.no-records {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-records i {
    font-size: 50px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Import/Export Section */
.import-export {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    border: 1px solid #eee;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.import-export h3 {
    color: #002b5b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

.import-export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.import-export-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    text-align: center;
    min-height: 100px;
    justify-content: center;
    position: relative;
}

.import-export-btn:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.import-export-btn i {
    font-size: 24px;
}

.import-export-btn span {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.export-btn {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.export-btn:hover {
    background: linear-gradient(135deg, #218838, #155724);
}

.import-label {
    background: linear-gradient(135deg, #17a2b8, #138496);
    cursor: pointer;
}

.import-label:hover {
    background: linear-gradient(135deg, #138496, #0c5460);
}

.salah-btn {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.salah-btn:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
}

.backup-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.backup-btn:hover {
    background: linear-gradient(135deg, #f57c00, #e65100);
}

.restore-btn {
    background: linear-gradient(135deg, #607d8b, #546e7a);
}

.restore-btn:hover {
    background: linear-gradient(135deg, #546e7a, #455a64);
}

.reset-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
}

.import-export-btn input[type="file"] {
    display: none;
}

/* Tooltip for buttons */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 43, 91, 0.95);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    width: 250px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 43, 91, 0.95);
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    margin-bottom: -12px;
}

.tooltip:hover::after,
.tooltip:hover::before {
    visibility: visible;
    opacity: 1;
    bottom: calc(100% + 10px);
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.footer-content {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 15px auto;
}

.footer-content p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.copyright {
    font-size: 13px;
    color: #a0d2db;
    margin-top: 15px;
    padding: 12px 20px;
    border-top: 1px solid rgba(21, 152, 149, 0.3);
    background: rgba(21, 152, 149, 0.05);
    border-radius: 8px;
    position: relative;
    font-weight: 500;
    text-align: center;
}

/* Subtle gradient border */
.copyright::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        #159895, 
        #1a5f7a, 
        #159895, 
        transparent);
    animation: borderGlow 3s infinite linear;
}

@keyframes borderGlow {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.copyright span {
    background: linear-gradient(90deg, 
        #a0d2db, #70c9d1, #159895, #70c9d1, #a0d2db);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 4s infinite linear;
}

@keyframes textGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.copyright i {
    margin-right: 8px;
    color: #159895;
    animation: iconFloat 2s infinite ease-in-out;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); color: #00fff7; }
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.spinner {
    font-size: 30px;
    margin-bottom: 15px;
    color: #159895;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .records-sidebar, .form-section {
        width: 100%;
    }
    
    .records-sidebar {
        max-height: 300px;
    }
    
    .form-section {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .back-btn {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 15px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    
    .form-container {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width, .form-actions {
        grid-column: span 1;
    }
    
    .threshold-group {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .import-export-buttons {
        grid-template-columns: 1fr;
    }
    
    .import-export-btn {
        min-height: 80px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 20px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .sidebar-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .add-new-btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .import-export {
        padding: 20px;
    }
}