/* Dragon Jockey - Main Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #764ba2;
}

.navbar-brand::before {
    content: "🐉";
    margin-right: 10px;
    font-size: 1.3em;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-menu a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
}

.navbar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}

.user-info {
    color: #666;
    font-size: 0.9em;
}

.user-info strong {
    color: #764ba2;
}

.logout-btn {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

/* Mobile menu toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: #667eea;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Content area */
.content {
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Headers */
.header, .page-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    text-align: center;
}

.header h1, .page-header h1 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p, .page-header p {
    color: #666;
    font-size: 1em;
}

/* Dashboard specific styles */
.header-controls {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.5);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.admin {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.control-btn.enable {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
}

.control-btn.disable {
    background: linear-gradient(135deg, #FF5722 0%, #D32F2F 100%);
}

.control-btn.refresh {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

.control-btn.logout {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.control-btn.loading {
    opacity: 0.6;
    cursor: wait;
}

.status-message {
    margin-top: 15px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95em;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Redis/Data Section Styles */
.redis-section, .data-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.redis-section h2, .data-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.redis-key, .data-key {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.redis-key:hover, .data-key:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.redis-key-header, .data-key-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.redis-key-header:hover, .data-key-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.redis-key-name, .data-key-name {
    font-weight: 600;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

.toggle-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.redis-key-content, .data-key-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.redis-key-content.expanded, .data-key-content.expanded {
    max-height: none;
    overflow: visible;
}

.json-viewer {
    padding: 20px;
    background: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    overflow-x: auto;
}

.json-key {
    color: #881391;
    font-weight: bold;
}

.json-string {
    color: #1A1AA6;
}

.json-number {
    color: #FF8C00;
}

.json-boolean {
    color: #0000FF;
}

.json-null {
    color: #808080;
}

.json-bracket {
    color: #000000;
    font-weight: bold;
}

.no-data {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 1.2em;
}

.expand-all-btn, .refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.expand-all-btn:hover, .refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.refresh-btn {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    margin-left: 10px;
}

.refresh-btn:hover {
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

/* Sites Overview Styles */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.site-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.site-card-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
}

.site-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.site-status.online {
    background: #4caf50;
    color: white;
}

.site-status.offline {
    background: #f44336;
    color: white;
}

.site-info {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.site-info-label {
    color: #666;
    font-weight: 500;
}

.site-info-value {
    color: #333;
    font-weight: 600;
}

.view-details-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.view-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.no-sites {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    color: #666;
    font-size: 1.2em;
}

.stats-summary {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Site Inspector Styles */
.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #764ba2;
    transform: translateX(-5px);
}

.site-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.detail-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

.status-available {
    color: #4caf50 !important;
    font-weight: 600;
}

.status-unavailable {
    color: #f44336 !important;
    font-weight: 600;
}

.availability-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.availability-indicator.availability-indicator-available {
    background: #4caf50;
}

.availability-indicator.availability-indicator-unavailable {
    background: #f44336;
}

/* Authentication Pages Styles */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
}

.auth-container.centered {
    text-align: center;
}

.auth-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-header h1 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.auth-header p {
    color: #666;
    font-size: 1em;
}

.auth-message {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 35px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    font-size: 0.95em;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-block;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.5);
}

.auth-btn:active {
    transform: translateY(0);
}

.help-text {
    text-align: center;
    margin-top: 25px;
    color: #666;
    font-size: 0.95em;
}

.footer-text {
    margin-top: 30px;
    color: #666;
    font-size: 0.95em;
}

.divider {
    margin: 25px 0;
    height: 1px;
    background: #e0e0e0;
}

.secondary-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.secondary-link:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .navbar-menu.active {
        max-height: 500px;
    }

    .navbar-menu li {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }

    .navbar-menu a {
        border-radius: 0;
    }

    .navbar-user {
        flex-direction: column;
        border-left: none;
        border-top: 2px solid #e0e0e0;
        padding: 15px 0 0 0;
        gap: 10px;
    }

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

    .site-details-grid {
        grid-template-columns: 1fr;
    }
}
