/* Base styles - extends style.css */
@import url('style.css');

/* Additional app styles */

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

nav .logo {
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text);
}

nav .user {
    font-size: 0.85rem;
    color: var(--muted);
}

nav .user a {
    color: var(--text);
    text-decoration: none;
}

nav .user a:hover {
    text-decoration: underline;
}

/* Cards */
.card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    background: white;
}

.card h2 {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--muted);
}

.card .value {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card .hint {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Status indicator */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.status-dot.online {
    background: #22c55e;
}

.status-dot.offline {
    background: #ef4444;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group .help {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    background: transparent;
    color: var(--accent);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--text);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Time inputs */
.time-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.time-row input[type="time"] {
    width: auto;
    padding: 0.5rem 0.75rem;
}

.time-row span {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Toggle switch */
.toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle input:checked + .toggle-switch {
    background: var(--accent);
}

.toggle input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

/* Connections list */
.connection {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.connection:last-child {
    border-bottom: none;
}

.connection-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.connection-name {
    font-weight: 500;
}

.connection-ext {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Invite code display */
.invite-code {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f5f5f0;
    border: 1px dashed var(--border);
    font-size: 1.25rem;
    letter-spacing: 0.1em;
}

.invite-code button {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Messages/alerts */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.message.success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.message.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Loading state */
.htmx-request {
    opacity: 0.6;
    pointer-events: none;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* SIP credentials display */
.credentials {
    font-family: inherit;
    font-size: 0.9rem;
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 1rem;
    overflow-x: auto;
}

.credentials .label {
    color: #888;
    margin-right: 0.5rem;
}

.credentials .line {
    margin-bottom: 0.5rem;
}

.credentials .line:last-child {
    margin-bottom: 0;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
    font-style: italic;
}

/* Getting Started Guide */
.getting-started {
    background: linear-gradient(135deg, #faf9f6 0%, #f5f0e8 100%);
    border: 2px solid var(--accent);
}

.getting-started h2 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.getting-started .intro {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.getting-started ol {
    margin: 0;
    padding: 0 0 0 1.5rem;
    counter-reset: step;
}

.getting-started ol li {
    margin-bottom: 1.25rem;
    padding-left: 0.5rem;
    line-height: 1.5;
}

.getting-started ol li:last-child {
    margin-bottom: 0;
}

.getting-started .step-title {
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

.getting-started .step-detail {
    font-size: 0.9rem;
    color: var(--muted);
}

.getting-started .step-detail a {
    color: var(--accent);
}

.getting-started .actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.getting-started .dismiss {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.getting-started .dismiss:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Setup Guide Styles */
h1 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.intro {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.guide-card {
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.guide-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.guide-card h2 {
    color: var(--text);
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
}

.guide-card .hint {
    margin-bottom: 1rem;
}

.setup-list {
    margin: 0;
    padding: 0 0 0 1.25rem;
    line-height: 1.8;
}

.setup-steps {
    margin: 0;
    padding: 0 0 0 1.25rem;
    line-height: 1.8;
}

.setup-steps li {
    margin-bottom: 0.75rem;
}

.setup-steps li:last-child {
    margin-bottom: 0;
}

.settings-table {
    background: #f8f8f6;
    border: 1px solid var(--border);
    margin: 1rem 0;
}

.setting-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-name {
    flex: 0 0 45%;
    padding: 0.75rem 1rem;
    background: #f0f0ec;
    font-weight: 500;
    border-right: 1px solid var(--border);
}

.setting-value {
    flex: 1;
    padding: 0.75rem 1rem;
    font-family: ui-monospace, monospace;
}

.setting-value em {
    font-family: inherit;
    color: var(--muted);
}

.success-card {
    background: #f0fdf4;
    border-color: #22c55e;
}

.success-card h2 {
    color: #166534;
}

.troubleshoot {
    margin: 0;
}

.troubleshoot dt {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.troubleshoot dd {
    margin: 0 0 1.5rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.troubleshoot dd:last-child {
    margin-bottom: 0;
}

.troubleshoot ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.troubleshoot li {
    margin-bottom: 0.25rem;
}

.help-list {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    line-height: 1.8;
}

code {
    background: #f0f0ec;
    padding: 0.15rem 0.4rem;
    font-size: 0.85em;
    font-family: ui-monospace, monospace;
}

/* Responsive */
@media (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .time-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .time-row input[type="time"] {
        width: 100%;
    }

    .invite-code {
        flex-direction: column;
        text-align: center;
    }

    .setting-row {
        flex-direction: column;
    }

    .setting-name {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .guide-cards {
        grid-template-columns: 1fr;
    }
}
