/* --- TriDev Control Panel & Login Styles --- */

:root {
    --modal-bg: rgba(26, 26, 26, 0.95);
    --modal-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-focus: rgba(212, 168, 83, 0.3);
    --error-color: #ff5e5e;
}

/* --- Login Modal --- */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.login-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-modal {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    transform: translateY(20px);
    transition: transform 0.4s var(--ease);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

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

.login-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #6b8cff);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(212, 168, 83, 0.05);
    box-shadow: 0 0 0 4px var(--input-focus);
}

.input-wrapper input:focus+i {
    color: var(--accent);
}

.login-btn {
    margin-top: 10px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(212, 168, 83, 0.2);
}

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

.login-error {
    color: var(--error-color);
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.visible {
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text);
}

/* --- Control Panel Dashboard --- */
.cp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 40px 60px;
}

.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.cp-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.cp-title p {
    margin-bottom: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-details span {
    display: block;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px;
    transition: color 0.3s ease;
}

.logout-btn:hover {
    color: var(--error-color);
}

.cp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.cp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.4s var(--ease);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cp-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-soft);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

.card-action {
    margin-top: auto;
}

.card-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-btn:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cp-card {
    animation: slideInUp 0.6s var(--ease) both;
}

.cp-card:nth-child(2) {
    animation-delay: 0.1s;
}

.cp-card:nth-child(3) {
    animation-delay: 0.2s;
}

.cp-card:nth-child(4) {
    animation-delay: 0.3s;
}

.cp-card:nth-child(5) {
    animation-delay: 0.4s;
}

.cp-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .cp-container {
        padding: 100px 20px 40px;
    }
}