/* Dashboard and common page styles - base.css handles background */

.dashboard-container{
    max-width:1100px;
    margin:48px auto;
    padding:28px;
    background:var(--cream);
    border-radius:20px;
    box-shadow:var(--card-shadow);
    border: 3px solid var(--deep-orange);
    position: relative;
    z-index: 10;
}

/* Ensure dashboard doesn't overlap with navbar */
@media (min-width: 769px) {
    .dashboard-container {
        margin-top: 20px; /* Extra space below navbar on desktop */
    }
}

.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.header h1{font-size:22px;margin:0;color:#3b2a20}
.muted{color:#8b6d5a;margin-top:4px}
.user-controls{display:flex;gap:10px;align-items:center}

.header .user-controls{justify-content:flex-end}

.logout-btn{background:transparent;border:2px solid var(--orange);padding:8px 14px;border-radius:999px;color:var(--deep-orange);font-weight:600;text-decoration:none}
.user-controls .logout-btn, .user-controls .add-agent-btn{
    padding:8px 14px;
    min-width:120px;
    text-align:center;
    display:inline-block;
    border-radius:999px;
    box-sizing:border-box;
}
.logout-btn.small{padding:8px 14px;font-size:14px}
.add-agent-btn{padding:8px 14px}
.logout-btn:hover{background:var(--orange);color:white}



.messages{margin:14px 0}
.message{padding:10px 12px;border-radius:10px}
.message.success{background:#e9f7ef;color:#1b5e20}

.main-grid{display:grid;grid-template-columns:1fr 400px;gap:20px}

.card{background:linear-gradient(180deg,#fff,#fff8f2);padding:20px;border-radius:var(--radius);box-shadow:0 6px 18px rgba(0,0,0,0.04);border:2.5px solid rgba(255,107,47,0.95);position:relative;z-index:10}
.card h2{margin:0 0 10px 0;color:#3b2a20}

.profile p{margin:8px 0;color:#6a4f3f}
.agent-list{list-style:none;padding:12px;margin:0;background:transparent}

/* Remove nested card visuals: no inner borders or heavy backgrounds on items */
.agent-list li{padding:10px 12px;border-radius:6px;margin:0 0 8px 0;background:transparent;border:none}
.agent-list li:last-child{margin-bottom:0}

.agent-name{font-weight:700;color:#3b2a20}
.agent-desc{font-size:13px;color:#7a5a48;margin-top:6px}
.agent-meta{font-size:12px;color:#9b7b6a;margin-top:8px;opacity:0.9}

/* subtle divider between items */
.agent-list li + li{border-top:1px solid rgba(107,75,59,0.06);padding-top:12px}

/* Agents table styles */
.agents-table{width:100%;border-collapse:collapse;background:transparent;table-layout:auto}
.agents-table thead th{background:transparent;text-align:left;padding:12px 16px;color:#3b2a20;font-size:15px;font-weight:600}
.agents-table tbody td{padding:12px 16px;border-top:1px solid rgba(107,75,59,0.06);vertical-align:middle;color:var(--muted)}
.agents-table tbody tr:hover{background:rgba(255,107,47,0.02)}
.agents-table .agent-name{width:15%;min-width:120px}
.agents-table .agent-desc{width:35%;min-width:200px}
.agents-table .agent-meta{width:15%;min-width:140px}
.agents-table .actions-cell{width:auto;white-space:nowrap;text-align:right;min-width:240px}
.agents-table .actions-cell button{margin-left:6px}

/* Back button in table header */
.back-btn{margin-right:auto;padding:6px 12px;border-radius:999px;text-decoration:none}

/* Mobile responsive table - converts to card-style layout on phones */
@media (max-width:768px){
    .agents-table{display:block;width:100%}
    .agents-table thead{display:none}
    .agents-table tbody{display:block;width:100%}
    .agents-table tr{
        display:block;
        width:100%;
        margin-bottom:16px;
        padding:12px;
        border:1.5px solid rgba(107,75,59,0.12);
        border-radius:10px;
        background:rgba(255,255,255,0.5);
    }
    .agents-table td{
        display:flex;
        padding:8px 0;
        border:none;
        position:relative;
        align-items:flex-start;
    }
    .agents-table td:before{
        content:attr(data-label);
        font-weight:700;
        color:#3b2a20;
        width:100px;
        flex-shrink:0;
        margin-right:12px;
    }
    .agents-table td:first-child{padding-top:0}
    .agents-table td:last-child{padding-bottom:0}
    
    /* Actions cell on mobile - stack buttons */
    .agents-table .actions-cell{
        flex-direction:column;
        align-items:stretch;
        gap:8px;
    }
    .agents-table .actions-cell:before{
        margin-bottom:8px;
    }
    .agents-table .actions-cell button{
        margin-left:0;
        width:100%;
        text-align:center;
    }
    
    /* Make section header stack on mobile */
    .section-header{
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
    }
    .back-btn{width:100%;text-align:center}
}

/* Agents section header + spacing improvements */
.section-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.section-header .view-all-btn{padding:6px 12px;border-radius:999px;text-decoration:none}

/* Add a little breathing room between the card border and the first agent */
.agent-list{padding-top:6px}

/* Prevent inner elements from visually touching the outer card's rounded border */
.card{overflow:visible}

/* Ensure agent items have a small top/bottom margin so they don't hug the card edges */
.agent-list li{margin:10px 0}

@media (max-width:900px){
    .main-grid{grid-template-columns:1fr;}
    .dashboard-container{
        margin:20px auto;
        padding:16px;
        border-radius:16px;
    }
    .header{
        flex-direction:column;
        align-items:flex-start;
        gap:12px;
    }
    .header h1{font-size:20px}
    .user-controls{width:100%}
    .logout-btn{display:block;width:100%;text-align:center}
}

/* Modal styles */
#edit-profile-modal,
#add-agent-modal,
#confirm-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.4);align-items:center;justify-content:center;z-index:1200}
#edit-profile-modal .modal-box,
#add-agent-modal .modal-box,
#confirm-modal .modal-box{background:white;padding:20px;border-radius:12px;max-width:720px;width:95%;margin:auto;box-shadow:0 10px 30px rgba(0,0,0,0.2);position:relative;max-height:90vh;overflow-y:auto}
#edit-profile-modal h3,
#add-agent-modal h3,
#confirm-modal h3{margin-top:0;color:#3b2a20}

/* Close button */
.modal-close{position:absolute;right:12px;top:10px;border:0;background:transparent;font-size:20px;line-height:1;padding:6px 8px;border-radius:6px;color:#8b6d5a;cursor:pointer}
.modal-close:hover{background:#f5f2ef}

/* Modal responsive styles */
@media (max-width:768px){
    #edit-profile-modal .modal-box{
        width:90%;
        padding:16px;
        max-height:85vh;
    }
    #edit-profile-modal h3{font-size:18px}
    #edit-profile-modal input{font-size:16px !important}
    #edit-profile-modal form > div:last-child{
        flex-direction:column;
    }
    #edit-profile-modal form > div:last-child button{
        width:100%;
    }
}

.logout-btn[style*="background:var(--orange)"]{border-color:var(--orange)}

/* disabled state for buttons */
.logout-btn.disabled, .logout-btn:disabled{
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .dashboard-container {
        margin: 0 auto 20px;
    }
}

/* delete button in agents table */
.delete-row-btn{
    background:transparent;
    border-color:#e65b2b;
    color:#e65b2b;
    padding:6px 10px;
    min-width: 80px;
}
.telegram-row-btn{
    background:transparent;
    border-color:#2b9be6;
    color:#2b9be6;
    padding:6px 10px;
    margin-right:6px;
    min-width: 80px;
}
.card.agents .telegram-row-btn.logout-btn:hover,
.agents .telegram-row-btn.logout-btn:hover,
.telegram-row-btn.logout-btn:hover{
    /* higher-specificity rules so the generic .logout-btn:hover doesn't override this */
    background:#2b9be6 !important;
    color:#ffffff !important;
    border-color:#2b9be6 !important;
}
.delete-row-btn:hover{
    background:#e65b2b !important;
    color:#ffffff !important;
    border-color:#e65b2b !important;
}
/* Telegram component vertical timeline styling */
/* Telegram component vertical timeline styling */
.telegram-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
/* vertical line runs between circles */
.telegram-steps::before {
    content: '';
    position: absolute;
    left: 11px; /* center under step-number */
    top: 12px;  /* start just below first circle */
    bottom: 12px; /* end just above last circle */
    width: 2px;
    background: rgba(107,75,59,0.15);
}
.telegram-steps li {
    position: relative;
    padding-left: 48px;
    margin-bottom: 24px;
}
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: #fff;
    color: #999;
    border: 2px solid #ddd;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}
.step-number.step-active {
    background: #2b9be6;
    color: #fff;
    border-color: #2b9be6;
}

/* Spotify player - small, outside main container with better contrast */
.spotify-external {
    max-width: 1100px;
    width: calc(100% - 56px);
    margin: 16px auto 48px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(30, 30, 35, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 900px) {
    .spotify-external {
        width: calc(100% - 40px);
        margin: 12px auto 32px;
    }
}

@media (max-width: 768px) {
    .spotify-external {
        width: calc(100% - 32px);
        margin: 10px auto 24px;
    }
}
