/* Modern Settings Page - Jony Ive Inspired Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
}

#settings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Section Headers */
h2 {
    font-size: 28px;
    font-weight: 300;
    color: #2c3e50;
    margin: 60px 0 30px 0;
    text-align: center;
    position: relative;
}

h2:first-child {
    margin-top: 0;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 1px;
}

/* Table Styling */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.1),
            0 2px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    max-height: 800px;
    overflow-y: auto;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

thead {
    background: var(--secondary-color);
    color: white;
}

thead th {
    color: white!important;
    padding: 16px 12px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-1px);
}

tbody td {
    padding: 16px 12px;
    border: none;
    vertical-align: middle;
}

/* Add Button */
.add-item {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.add-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.add-item:hover::before {
    left: 100%;
}

.add-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.4);
}

.add-item:active {
    transform: translateY(0);
}

/* Action Buttons */
.action-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    margin: 0 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.action-btn.edit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.action-btn.edit:hover {
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.popup-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.2),
            0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.popup-overlay.active .popup-container {
    transform: scale(1) translateY(0);
}

/* Popup Header */
.popup-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.popup-title {
    font-size: 24px;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 10px;
}

.popup-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.popup-close:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

/* Form Styling */
.popup-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.form-input {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.form-input[type="file"] {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
}

.form-input[type="color"] {
    height: 50px;
    padding: 4px;
    cursor: pointer;
}

.form-input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 12px;
}

.checkbox-group label {
    font-size: 16px;
    color: #555;
    cursor: pointer;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .popup-container {
        padding: 30px 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }

    .table-container {
        padding: 20px;
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    h2 {
        font-size: 24px;
    }
}

/* File Upload Section */
.file-upload-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 2px dashed rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.file-upload-section:hover {
    border-color: rgba(52, 152, 219, 0.6);
    background: linear-gradient(135deg, #f1f3f4 0%, #e2e6ea 100%);
}

.file-upload-section h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.upload-container {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#hardware-file-upload {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#hardware-file-upload:hover {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.95);
}

.extract-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 150px;
}

.extract-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.extract-btn:hover::before {
    left: 100%;
}

.extract-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.extract-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.upload-info {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 12px;
    font-style: italic;
}

@media (max-width: 600px) {
    .upload-container {
        flex-direction: column;
    }

    #hardware-file-upload {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #27ae60 100%);
}