/* ========================================
   Alarm Page Styles - Luxury Gold Theme
   Matches main dashboard aesthetics
   ======================================== */

:root {
    --gold-primary: #f2c75c;
    --gold-dark: #b88a32;
    --gold-light: #fff5c5;

    --bg-dark: #000000;
    --bg-card: #050505;
    --bg-card-gradient: linear-gradient(180deg, #1a1508 0%, #050505 100%);

    --font-header: 'Cinzel', serif;
    --font-number: 'Oswald', sans-serif;

    --text-primary: #fff5c5;
    --text-secondary: #88703a;
    --text-muted: #666;

    --border-gold: #b88a32;
    --border-gold-glow: rgba(212, 175, 55, 0.3);

    --success: #4caf50;
    --danger: #f44336;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-number);
    background: var(--bg-dark);
    background-image: url('bg-luxury.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overscroll-behavior-y: contain;
}

/* Pull to Refresh */
.ptr-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.ptr-container.pulling {
    transform: translateY(0);
}

.ptr-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
}

.ptr-container.refreshing .ptr-spinner {
    animation: ptr-spin 0.8s linear infinite;
}

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

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: transparent;
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: none;
}

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

.logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.logo-text {
    font-family: var(--font-header);
    color: var(--gold-primary);
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header h1 {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff5c5 0%, #d4af37 40%, #8a6e2f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    text-shadow: 0px 0px 20px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
    margin: 0;
}

.version-badge {
    font-family: var(--font-number);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-gold);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Main */
.main {
    flex: 1;
    padding: 1rem 1.5rem;
    width: 100%;
    /* Remove generic container styles that might conflict or be redundant in modal */
}

/* Sections */
.section {
    margin-bottom: 2rem;
    /* Reduced for modal compactness */
}

/* Modal Specific Adjustments */
.modal-body .alarm-form {
    padding: 1.5rem;
    /* Slightly compact form */
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.section-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(184, 138, 50, 0.3);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header h2 {
    font-family: var(--font-header);
    color: var(--gold-primary);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--gold-primary);
}

/* Forms */
.alarm-form {
    background: var(--bg-card-gradient);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 0 15px rgba(212, 175, 55, 0.1);
    position: relative;
}

.alarm-form::before {
    /* Top ornamental line simulation */
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b88a32, transparent);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group label {
    font-family: var(--font-number);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    background: #0a0a0a;
    border: 1px solid #333;
    border-bottom: 2px solid var(--border-gold);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--gold-primary);
    font-family: var(--font-number);
    font-size: 1.1rem;
    letter-spacing: 1px;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: #111;
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.form-hint {
    font-family: var(--font-number);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
    min-height: 1.4em;
    padding-left: 2px;
}

/* Buttons */
.btn {
    font-family: var(--font-number);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(to bottom, #d4af37 0%, #8a6e2f 100%);
    color: #000;
    border: 1px solid #ffd700;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #ffd700 0%, #b88a32 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #333;
    border-color: #444;
    color: #666;
    box-shadow: none;
}

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

.btn-secondary:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

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

/* Alarm Cards */
.alarm-card {
    background: var(--bg-card-gradient);
    border: 2px solid transparent;
    border-image: linear-gradient(to bottom, #333, #111) 1;
    /* Fallback */
    border: 1px solid #333;
    /* Fallback */
    border-radius: var(--radius-sm);
    /* Note: standard border-radius conflict with border-image */
    /* Let's stick to the box-shadow/border trick from main site for corners */
    border: 2px solid #333;
    border-bottom: 2px solid var(--border-gold);

    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.alarm-card:hover {
    border-color: var(--gold-dark);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

/* Triggered state */
.alarm-card.triggered {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.alarm-card.triggered::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.05);
    pointer-events: none;
}

.alarm-icon {
    font-size: 2rem;
    color: var(--gold-primary);
    background: transparent;
}

.alarm-title {
    font-family: var(--font-header);
    color: var(--gold-primary);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.alarm-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

.alarm-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

/* Price Grid */
.prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.price-card {
    background: var(--bg-card-gradient);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

.price-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.9);
    border-color: var(--gold-primary);
}

.price-label {
    font-family: var(--font-number);
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(184, 138, 50, 0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.price-value {
    color: var(--gold-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: right;
}

.price-direction.up {
    color: var(--success);
}

.price-direction.down {
    color: var(--danger);
}

/* Banners */
.permission-banner {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.banner-text strong {
    color: var(--gold-primary);
    font-family: var(--font-header);
    letter-spacing: 1px;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.status-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #111;
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2rem;
}

.status-banner.connected {
    border-color: var(--success);
    color: var(--success);
}

/* Footer */
.footer {
    border-top: 1px solid #222;
    padding: 2rem;
    text-align: center;
    color: #444;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .alarm-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .alarm-actions {
        justify-content: center;
        margin-top: 1rem;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
    }
}