/* 
 * AetherMUD Webclient Styles
 * Integrates Evennia webclient with the AetherMUD purple/dark theme
 */

/* ========================================================================
   WEBCLIENT WRAPPER & LAYOUT
   ======================================================================== */

.webclient-wrapper {
    background: rgba(10, 10, 15, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(126, 87, 194, 0.3);
    box-shadow: 0 0 30px rgba(126, 87, 194, 0.2);
    overflow: hidden;
    margin-top: 2rem;
}

.webclient-header {
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.2), rgba(149, 117, 205, 0.1));
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(126, 87, 194, 0.3);
    text-align: center;
}

.webclient-title {
    color: var(--accent-color, #7e57c2);
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 10px rgba(126, 87, 194, 0.5);
}

.webclient-subtitle {
    color: var(--accent-glow, #9575cd);
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    font-style: italic;
}

/* ========================================================================
   CONNECTION STATUS INDICATOR
   ======================================================================== */

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(126, 87, 194, 0.2);
    margin-top: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.connected {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.status-indicator.disconnected {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
    animation: none;
}

.status-text {
    color: var(--text-color, #e0e0e0);
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================================================
   WEBCLIENT CONTAINER (IFRAME)
   ======================================================================== */

.webclient-container {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background: #000;
}

.evennia-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

/* ========================================================================
   FALLBACK MESSAGE (When server is down)
   ======================================================================== */

.webclient-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.95), rgba(21, 21, 32, 0.95));
    padding: 2rem;
}

.fallback-content {
    max-width: 600px;
    text-align: center;
    color: var(--text-color, #e0e0e0);
}

.fallback-content h2 {
    color: var(--accent-color, #7e57c2);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.fallback-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.fallback-content ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
    display: inline-block;
}

.fallback-content li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.fallback-content li:before {
    content: '✧';
    position: absolute;
    left: 0;
    color: var(--accent-color, #7e57c2);
}

.fallback-content code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: inline-block;
    margin: 0.3rem 0;
}

.alternative-connection {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(126, 87, 194, 0.2);
}

.alternative-connection h3 {
    color: var(--accent-glow, #9575cd);
    margin-bottom: 1rem;
}

.telnet-info {
    text-align: left;
    display: inline-block;
    margin-top: 1rem;
}

.telnet-info p {
    margin: 0.5rem 0 0.3rem 0;
    font-weight: bold;
}

/* ========================================================================
   WEBCLIENT FOOTER
   ======================================================================== */

.webclient-footer {
    padding: 1.5rem 2rem;
    background: rgba(10, 10, 15, 0.8);
    border-top: 1px solid rgba(126, 87, 194, 0.2);
    text-align: center;
}

.footer-note {
    color: var(--text-color, #e0e0e0);
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.8;
}

.back-link {
    color: var(--accent-color, #7e57c2);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 0.5rem;
}

.back-link:hover {
    color: var(--accent-glow, #9575cd);
    text-shadow: 0 0 10px rgba(126, 87, 194, 0.4);
}

/* ========================================================================
   CUSTOM EVENNIA INTEGRATION STYLES
   (For when you implement full custom integration instead of iframe)
   ======================================================================== */

/* These styles are for future use when you copy Evennia's webclient files */

#evennia-main-output {
    background: #000;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    padding: 1rem;
    overflow-y: auto;
    height: calc(100% - 80px);
}

#evennia-input {
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(126, 87, 194, 0.3);
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    padding: 0.8rem;
    width: 100%;
    font-size: 1rem;
}

#evennia-input:focus {
    outline: none;
    border-color: var(--accent-color, #7e57c2);
    box-shadow: 0 0 10px rgba(126, 87, 194, 0.3);
}

/* ANSI Color Support (Standard 16 colors) */
.ansi-black { color: #000000; }
.ansi-red { color: #cd3131; }
.ansi-green { color: #0dbc79; }
.ansi-yellow { color: #e5e510; }
.ansi-blue { color: #2472c8; }
.ansi-magenta { color: #bc3fbc; }
.ansi-cyan { color: #11a8cd; }
.ansi-white { color: #e5e5e5; }

.ansi-bright-black { color: #666666; }
.ansi-bright-red { color: #f14c4c; }
.ansi-bright-green { color: #23d18b; }
.ansi-bright-yellow { color: #f5f543; }
.ansi-bright-blue { color: #3b8eea; }
.ansi-bright-magenta { color: #d670d6; }
.ansi-bright-cyan { color: #29b8db; }
.ansi-bright-white { color: #ffffff; }

/* ANSI Background Colors */
.ansi-bg-black { background-color: #000000; }
.ansi-bg-red { background-color: #cd3131; }
.ansi-bg-green { background-color: #0dbc79; }
.ansi-bg-yellow { background-color: #e5e510; }
.ansi-bg-blue { background-color: #2472c8; }
.ansi-bg-magenta { background-color: #bc3fbc; }
.ansi-bg-cyan { background-color: #11a8cd; }
.ansi-bg-white { background-color: #e5e5e5; }

/* ANSI Text Formatting */
.ansi-bold { font-weight: bold; }
.ansi-italic { font-style: italic; }
.ansi-underline { text-decoration: underline; }
.ansi-blink { animation: blink 1s step-start infinite; }

@keyframes blink {
    50% { opacity: 0; }
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 768px) {
    .webclient-header {
        padding: 1rem;
    }
    
    .webclient-title {
        font-size: 1.5rem;
    }
    
    .webclient-subtitle {
        font-size: 0.9rem;
    }
    
    .webclient-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .fallback-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .webclient-container {
        height: 50vh;
        min-height: 350px;
    }
    
    .connection-status {
        font-size: 0.8rem;
    }
    
    .webclient-footer {
        padding: 1rem;
    }
}

/* ========================================================================
   FULL-HEIGHT VARIANT (Optional)
   ======================================================================== */

/* Uncomment this if you want the webclient to take up more screen space */
/*
.webclient-container {
    height: 80vh;
    min-height: 600px;
}
*/
