/* lib/user_dashboard.css */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

/* Universe Background */
.universe-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

/* Nebula Layers */
.nebula {
    position: absolute;
    filter: blur(100px);
    opacity: 0.25;
    will-change: transform, opacity;
    animation: nebulaDrift 30s infinite ease-in-out;
}

.nebula-1 {
    width: 50%;
    height: 50%;
    top: 10%;
    left: 10%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.5), transparent);
}

.nebula-2 {
    width: 40%;
    height: 40%;
    top: 40%;
    right: 20%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent);
}

.nebula-3 {
    width: 60%;
    height: 60%;
    bottom: 0%;
    left: 30%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent);
}

@keyframes nebulaDrift {
    0% { transform: translate(-5%, -5%) scale(1); opacity: 0.25; }
    50% { transform: translate(5%, 5%) scale(1.02); opacity: 0.35; }
    100% { transform: translate(-5%, -5%) scale(1); opacity: 0.25; }
}

/* Distant Planet */
.planet {
    position: absolute;
    width: 120px;
    height: 120px;
    bottom: 20%;
    right: 15%;
    background: radial-gradient(circle at 30% 30%, #1e40af, #1e293b);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(30, 64, 175, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.8);
    opacity: 0.85;
}

/* Orbital Moon */
.moon {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 40% 40%, #e2e8f0, #64748b);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(226, 232, 240, 0.3);
    opacity: 0.9;
    z-index: 5;
}

/* Meteors with Green Trails */
.meteor {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #22c55e, #16a34a);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.9), 0 0 40px rgba(34, 197, 94, 0.5);
    opacity: 0.9;
    z-index: 4;
}

.meteor::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 3px;
    background: linear-gradient(to left, rgba(34, 197, 94, 0.7), transparent);
    filter: blur(2px);
    top: 50%;
    left: -296px;
    transform: translateY(-50%);
    z-index: -1;
    animation: shimmer 1.5s infinite ease-in-out;
}

@keyframes shimmer {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Login Wrapper */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
    z-index: 10;
}

/* Login Container */
.login-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25), inset 0 0 8px rgba(255, 255, 255, 0.02);
    max-width: 400px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 500;
    color: #f8fafc;
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.95rem;
    color: #f8fafc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:hover {
    border-color: #60a5fa;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
}

.password-toggle:hover {
    color: #3b82f6;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #3b82f6;
}

/* CAPTCHA */
.captcha-group {
    text-align: center;
    margin-bottom: 1.5rem;
}

.captcha-question {
    color: #f8fafc;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Button */
#loginButton {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #3b82f6, #6b7280);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, transform 0.3s ease;
}

#loginButton:hover:not(.loading) {
    background: linear-gradient(135deg, #2563eb, #4b5563);
    transform: translateY(-1px);
}

#loginButton::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

#loginButton:active::before {
    width: 200px;
    height: 200px;
}

/* Error Message */
.error-message {
    color: #ef4444;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* Logo */
.logo img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.25rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f8fafc;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.subtitle {
    text-align: center;
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Dashboard-Specific Styles */
.main-content {
    padding: 20px;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    background: #fff;
    margin-bottom: 20px;
}
.card:hover {
    transform: translateY(-5px);
}
.card-header {
    background: linear-gradient(90deg, #007bff, #00d4ff);
    color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 15px;
}
.card-body {
    padding: 20px;
    color: #333;
}

.summary-card {
    text-align: center;
    background: linear-gradient(90deg, #28a745, #20c997);
    color: #fff;
}
.summary-card .card-body {
    color: #fff;
}

.chart-container {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.welcome-header {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}
.table th, .table td {
    vertical-align: middle;
}

.logout-button-wrapper {
    text-align: center;
}
.btn-danger {
    border-radius: 25px;
    padding: 10px 20px;
    transition: background-color 0.3s;
}
.btn-danger:hover {
    background-color: #c82333;
}

/* Button Styles for index.php and user_panel.php */
.user-panel-button, .back-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    color: white;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s;
}
.user-panel-button {
    background-color: #28a745;
}
.user-panel-button:hover {
    background-color: #218838;
}
.back-button {
    background-color: #6c757d;
}
.back-button:hover {
    background-color: #5a6268;
}

/* Traffic Bar Styles */
.traffic-container {
    min-width: 200px;
    margin: 10px 0;
    position: relative;
}

.traffic-bar-container {
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    height: 20px;
    position: relative;
}

.traffic-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.traffic-bar.high-usage {
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.traffic-text-centered {
    font-size: 12px;
    color: #000000;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 5px;
}

.traffic-warning-icon {
    color: #ffffff;
    font-size: 12px;
}

/* Mobile-Friendly Adjustments */
@media (max-width: 767px) {
    /* General Adjustments */
    .main-content {
        padding: 10px;
    }

    .card {
        margin-bottom: 10px;
    }

    /* Top Center Cards */
    .summary-card h5 {
        font-size: 0.9rem;
    }
    .summary-card .h3 {
        font-size: 1.2rem;
    }
    .summary-card .card-body {
        padding: 10px;
    }
    .summary-card .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Charts */
    .chart-container {
        padding: 10px;
        min-width: 100%; /* Ensure chart container takes full width */
    }
    #lineChart {
        height: 250px !important; /* Slightly increased for better visibility */
    }
    #pieChart {
        height: 200px !important;
    }

    /* Tables */
    .table th, .table td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    .traffic-container {
        min-width: 150px;
    }
    .traffic-text-centered {
	    color: #000000;
        font-size: 10px;
    }
    .traffic-bar-container {
        height: 18px;
    }
    .traffic-warning-icon {
		color: #ffffff;
        font-size: 10px;
    }

    /* Welcome Header */
    .welcome-header h2 {
        font-size: 1.2rem;
    }
    .welcome-header p {
        font-size: 0.8rem;
    }
}

/* Responsive Design (Existing) */
@media (max-width: 480px) {
    .login-container {
        padding: 2rem;
        max-width: 100%;
    }
    h1 { font-size: 1.5rem; }
    .subtitle { font-size: 0.9rem; }
    #loginButton { font-size: 0.95rem; }
    .planet { width: 100px; height: 100px; }
    .moon { width: 25px; height: 25px; }
    .meteor { width: 6px; height: 6px; }
    .meteor::after { width: 250px; }
    .main-content { padding: 10px; }
    .card { margin-bottom: 15px; }
}
/* User Card Two-Column Layout */
.user-card-two-columns p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-card-two-columns p strong {
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-card-two-columns p strong i {
    font-size: 1rem;
    color: #007bff;
}

.user-card-two-columns .row {
    margin: 0;
}

.user-card-two-columns .col-6 {
    padding: 0 0.5rem;
}

/* Mobile Adjustments for Two-Column User Card */
@media (max-width: 767px) {
    .user-card-two-columns .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
    }

    .user-card-two-columns p {
        font-size: 0.85rem;
    }

    .user-card-two-columns p strong i {
        font-size: 0.9rem;
    }
.user-card-two-columns p.expiring-soon {
    color: #ffcc00;
}
.user-card-two-columns p.expiring-soon strong {
    color: #ffcc00;
}
}