/* Phostr Relay - Light Blue Theme */

:root {
    /* Primary Blues */
    --sky-blue: #87CEEB;
    --light-blue: #ADD8E6;
    --steel-blue: #4682B4;
    --hover-blue: #6BA3D4;
    
    /* Neutrals */
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    --light-grey: #F5F5F5;
    --medium-grey: #E0E0E0;
    --dark-grey: #9E9E9E;
    --text-dark: #333333;
    --text-light: #666666;
    
    /* Semantic */
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --info: var(--steel-blue);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-grey);
    color: var(--text-dark);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--sky-blue), var(--steel-blue));
    color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-title {
    flex: 1;
}

.header-logo {
    max-height: 60px;
    width: auto;
    display: block;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

#auth-login-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#auth-user-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.95;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
}

/* Button in header */
.btn-header {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Dropdown menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--light-grey);
}

.dropdown-item:first-child {
    color: var(--steel-blue);
    font-weight: 500;
}

.logout-btn {
    color: var(--error);
    border-top: 1px solid var(--medium-grey);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    padding: 0rem 2rem;
    position: relative;
    z-index: 1;
}

/* Watermark background */
.container::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background-image: url('/images/logo5.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--medium-grey);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-blue);
}

.card-title {
    font-size: 1.25rem;
    color: var(--steel-blue);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--hover-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--medium-grey);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--dark-grey);
    color: var(--white);
}

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

.btn-danger {
    background: var(--error);
    color: var(--white);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--medium-grey);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--steel-blue);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Event Feed */
.event {
    background: var(--off-white);
    border-left: 4px solid var(--light-blue);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.event-pubkey {
    font-family: monospace;
    color: var(--steel-blue);
    font-weight: 600;
}

.event-time {
    color: var(--dark-grey);
}

.event-content {
    color: var(--text-dark);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.event-kind {
    display: inline-block;
    background: var(--light-blue);
    color: var(--steel-blue);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Status indicators */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-connected {
    background: var(--success);
    color: var(--white);
}

.status-disconnected {
    background: var(--error);
    color: var(--white);
}

.status-connecting {
    background: var(--warning);
    color: var(--white);
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--medium-grey);
    border-top-color: var(--steel-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #E8F5E9;
    border-color: var(--success);
    color: #2E7D32;
}

.alert-error {
    background: #FFEBEE;
    border-color: var(--error);
    color: #C62828;
}

.alert-info {
    background: #E3F2FD;
    border-color: var(--info);
    color: #1565C0;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 4px solid var(--light-blue);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--steel-blue);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
footer {
    background: var(--steel-blue);
    color: var(--white);
    flex-shrink: 0;
    text-align: center;
    padding: 0rem 2rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.footer-mascot {
    height: 75px;
    width: auto;
    opacity: 0.9;
}

.footer-text {
    text-align: center;
}

footer a {
    color: var(--light-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-logo {
        max-height: 40px;
    }

    .header-auth {
        width: 100%;
        justify-content: flex-end;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .user-info {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-mascot {
        height: 50px;
    }

    .container::before {
        width: 300px;
        height: 300px;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none; }

.footer-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.footer-meta p {
    margin: 0;
}

.footer-separator {
    margin: 0 0.5rem;
    opacity: 0.7;
}
