/* Premium Dashboard Design System */
:root {
    --bg-color: #050507;
    --sidebar-bg: #0c0c0f;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-primary: #7c4dff;
    --accent-secondary: #00e5ff;
    --text-main: #ffffff;
    --text-muted: #a0a0ab;
    --glass-blur: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.sidebar-nav h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding-left: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
    padding-right: 0.5rem;
}

.add-section-btn {
    background: rgba(124, 77, 255, 0.1);
    border: none;
    color: var(--accent-primary);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.add-section-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.nav-item {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item .nav-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-muted);
}

.nav-item:hover, .nav-item.active {
    background: rgba(124, 77, 255, 0.1);
    color: var(--text-main);
}

.nav-item.active {
    box-shadow: inset 0 0 0 1px var(--accent-primary);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.search-bar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff4081, #7c4dff);
}

/* Platforms Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

.section-title {
    grid-column: 1 / -1;
    margin: 2rem 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--card-border), transparent);
}

.section-title:first-child {
    margin-top: 0;
}

/* Platform Card */
.platform-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.platform-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(124, 77, 255, 0.2);
}

.logo-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-logo {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.platform-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.platform-info {
    text-align: center;
}

.platform-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.credential-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.credential-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.credential-value {
    font-size: 0.9rem;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
}

.description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 1.2rem 0;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    filter: brightness(1.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-card {
    animation: fadeInSlideUp 0.5s ease backwards;
}

/* Authentication Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-active .app-container {
    filter: blur(10px);
    pointer-events: none;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Modal System */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-container.active {
    display: flex;
    opacity: 1;
}

.modal {
    width: 100%;
    max-width: 600px;
    background: #0f0f12;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-container.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

.detail-body {
    margin-top: 1rem;
}

.detail-field {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 15px;
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
}

.detail-field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.detail-field .value {
    font-size: 1.1rem;
    word-break: break-all;
    font-family: 'Outfit', sans-serif;
}

.detail-field .value-mono {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
    color: var(--accent-secondary);
}

.detail-modal {
    max-width: 500px;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 30px;
    border: 1px dashed var(--card-border);
}

.empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.2;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.5rem;
    }
    .sidebar .logo-section span,
    .sidebar .nav-item span,
    .sidebar-nav h3 {
        display: none;
    }
    .main-content {
        margin-left: 80px;
    }
}
