/* URL Shortener - Black Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    color: #888;
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 500;
}

.alert.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b6b;
}

.alert.success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #6bff8d;
}

.alert.info {
    background: rgba(23, 162, 184, 0.2);
    border: 1px solid #17a2b8;
    color: #6bd7ff;
}

/* Forms */
.form {
    max-width: 500px;
    margin: 0 auto;
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.4);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #007bff;
}

.stat-card h3 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
}

/* Links Table */
.links-table-container {
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid #333;
    overflow: hidden;
    margin-bottom: 30px;
}

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

.links-table th {
    background: #252525;
    padding: 20px;
    text-align: left;
    color: #fff;
    font-weight: 600;
    border-bottom: 1px solid #333;
}

.links-table td {
    padding: 20px;
    border-bottom: 1px solid #333;
}

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

.links-table tr:hover {
    background: #252525;
}

.short-url {
    color: #007bff;
    font-weight: 600;
    text-decoration: none;
}

.short-url:hover {
    text-decoration: underline;
}

.original-url {
    color: #888;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.analytics-card {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
}

.analytics-card h3 {
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.chart-bar {
    height: 10px;
    background: #333;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 5px;
}

.analytics-item {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid #252525;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    border: 1px solid #333;
    position: relative;
}

.modal-header {
    margin-bottom: 30px;
}

.modal-header h2 {
    color: #fff;
    font-size: 1.8rem;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #666;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }
.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .links-table {
        display: block;
        overflow-x: auto;
    }
    
    .actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-small {
        width: 100%;
    }
}
/* Add these to the existing style.css file */

/* Scroll containers for analytics */
.scroll-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar styling */
.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 4px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal sizing for analytics */
.modal-content.large-modal {
    max-width: 90%;
    max-height: 90vh;
    width: 1200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Analytics grid adjustments */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0;
}

.analytics-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.analytics-card h3 {
    flex-shrink: 0;
}

.analytics-card .scroll-container {
    flex: 1;
    min-height: 0; /* Important for flex child scrolling */
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid #333;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}