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

html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fb;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    height: 100%;
}

a {
    color: #4054b2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
}

/* Login Page */
.login-body {
    background-color: #f5f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    max-width: 400px;
    width: 100%;
}

.login-box {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #4054b2;
    margin-bottom: 10px;
}

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

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-login {
    width: 100%;
    padding: 12px;
}

.error-message {
    color: #e74c3c;
    background-color: #fde8e7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Dashboard Layout */
.dashboard-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    padding: 0 30px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.brand a {
    display: flex;
    align-items: center;
    color: #4054b2;
    font-weight: bold;
    text-decoration: none;
}

.brand-name {
    font-size: 18px;
}

.content-wrapper {
    margin-left: 250px;
    padding: 80px 20px 80px 20px;
    flex-grow: 1;
    padding-bottom: 80px;
}

.main-footer {
    margin-left: 250px;
    padding: 15px 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    position: relative;
    clear: both;
    margin-top: 20px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
    z-index: 90;
    overflow-y: auto;
}

.sidebar-nav ul {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #5a6169;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a svg {
    margin-right: 10px;
    color: #999;
}

.sidebar-nav a.active, .sidebar-nav a:hover {
    background-color: #f8f9fa;
    color: #4054b2;
}

.sidebar-nav a.active svg, .sidebar-nav a:hover svg {
    color: #4054b2;
}

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 500;
}

.header-back-button {
    margin-right: 15px;
}

.btn-back {
    display: flex;
    align-items: center;
    color: #666;
}

.btn-back svg {
    margin-right: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.card-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #4054b2;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(64, 84, 178, 0.25);
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-check-input {
    margin-right: 10px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background-color: #4054b2;
    color: #fff;
}

.btn-primary:hover {
    background-color: #354499;
}

.btn-secondary {
    background-color: #f0f2f5;
    color: #444;
}

.btn-secondary:hover {
    background-color: #e4e7ec;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #d73c2c;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background-color: #f0f2f5;
    color: #4054b2;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 500;
    color: #333;
}

.table tr:hover {
    background-color: #f9f9f9;
}

.table tr:last-child td {
    border-bottom: none;
}

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

/* Alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    transition: opacity 0.5s;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-dialog {
    margin: 80px auto;
    max-width: 600px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-content {
    position: relative;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #333;
}

.user-dropdown-btn svg:first-child {
    margin-right: 8px;
}

.user-dropdown-btn svg:last-child {
    margin-left: 5px;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 160px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 1;
}

.user-dropdown-content.show {
    display: block;
}

.user-dropdown-content a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
}

.user-dropdown-content a svg {
    margin-right: 8px;
}

.user-dropdown-content a:hover {
    background-color: #f5f5f5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    background-color: rgba(64, 84, 178, 0.1);
}

.stat-icon svg {
    color: #4054b2;
}

.stat-details {
    flex-grow: 1;
}

.stat-title {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 500;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
}

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

/* URL Display */
.url-display, .token-display {
    display: flex;
    align-items: center;
}

.url-display input, .token-display .token {
    flex-grow: 1;
}

.token {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar-nav a span {
        display: none;
    }
    
    .sidebar-nav a svg {
        margin-right: 0;
    }
    
    .content-wrapper, .main-footer {
        margin-left: 80px;
    }
}

@media (max-width: 767px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        margin-top: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-dialog {
        margin: 40px 20px;
    }
}

/* Row & Column layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.col-12, .col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
}

.mt-4 {
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Text utilities */
.text-danger {
    color: #e74c3c;
}

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

.text-right {
    text-align: right;
}

.text-muted {
    color: #6c757d;
}

/* Other utilities */
.d-inline {
    display: inline;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Copy button and tooltip styles */
.copy-btn {
    position: relative;
}

.copy-tooltip {
    position: absolute;
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: fadeInOut 1.5s;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Fraud/Bots Warning Styles */
.bots-warning {
    color: #dc2626 !important;
    font-weight: 600;
}

.fraud-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.fraud-indicator.fraud {
    background: #fee2e2;
    color: #dc2626;
}

.fraud-indicator.suspicious {
    background: #fef3c7;
    color: #d97706;
}

.fraud-indicator.clean {
    background: #dcfce7;
    color: #16a34a;
}
