/* StorageVault - DataEdge Theme */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-title {
    margin-bottom: 20px;
}

.header-title h1 {
    font-size: 2em;
    color: #60a5fa;
    font-weight: 600;
    margin-bottom: 6px;
}

.subtitle {
    color: #94a3b8;
    font-size: 1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #34d399);
    opacity: 0.7;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(59, 130, 246, 0.3);
    padding: 20px;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section h3 {
    font-size: 0.95em;
    color: #60a5fa;
    margin-bottom: 12px;
    font-weight: 600;
}

.input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(51, 65, 85, 0.8);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-block {
    width: 100%;
    margin-bottom: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #34d399);
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #34d399, #3b82f6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #34d399;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8em;
}

.apps-breakdown {
    max-height: 300px;
    overflow-y: auto;
}

.app-item {
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.app-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #34d399;
}

.app-name {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.app-stats {
    font-size: 0.8em;
    color: #94a3b8;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.4);
    overflow: hidden;
}

.content-header {
    padding: 20px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h2 {
    font-size: 1.3em;
    color: #60a5fa;
    font-weight: 600;
}

.filtered-count {
    font-size: 0.9em;
    color: #94a3b8;
}

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

.storage-table {
    width: 100%;
    border-collapse: collapse;
}

.storage-table thead {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.storage-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #60a5fa;
    border-bottom: 2px solid rgba(52, 211, 153, 0.3);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.storage-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    color: #e2e8f0;
    font-size: 0.9em;
}

.storage-table tbody tr {
    background: rgba(51, 65, 85, 0.3);
    transition: all 0.3s ease;
}

.storage-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.col-key {
    width: 35%;
    font-family: 'Consolas', monospace;
    color: #34d399;
    font-weight: 500;
}

.col-type {
    width: 12%;
}

.col-size {
    width: 12%;
}

.col-preview {
    width: 28%;
}

.col-actions {
    width: 13%;
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.type-json {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-encrypted {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.type-text {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.size-text {
    color: #94a3b8;
    font-family: 'Consolas', monospace;
}

.preview-text {
    color: #cbd5e1;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-message {
    text-align: center;
    padding: 40px !important;
    color: #64748b;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3em;
    color: #60a5fa;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 1.5em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.3);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.9em;
}

.textarea {
    width: 100%;
    padding: 12px;
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    resize: vertical;
    transition: all 0.3s ease;
}

.textarea:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(51, 65, 85, 0.8);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.4);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.6);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 16px;
    }

    .header-title h1 {
        font-size: 1.5em;
    }

    .storage-table th,
    .storage-table td {
        padding: 10px 8px;
        font-size: 0.8em;
    }

    .col-preview {
        display: none;
    }

    .modal-content {
        width: 95%;
    }
}
