/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 5px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* Section styles */
section {
    background-color: white;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#refresh-button {
    margin-bottom: 20px;
}

/* Result styles */
.result {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.short-url-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#short-url {
    font-size: 18px;
    color: #3498db;
    word-break: break-all;
}

#copy-button {
    padding: 8px 15px;
    font-size: 14px;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

th {
    background-color: #f2f2f2;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

/* URL cell styles */
.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading and empty state styles */
.loading, .no-urls {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

/* Footer styles */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: #777;
    font-size: 14px;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 15px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    /* Stack QR code buttons vertically on mobile */
    .qr-code-cell {
        min-width: 100px;
    }
    
    .qr-download-button,
    .qr-retry-button {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Click count styling */
.clicks-cell {
    font-weight: bold;
    text-align: center;
}

/* Sort indicators */
th.sortable {
    cursor: pointer;
}

th.sortable::after {
    content: " ↕";
    font-size: 0.8em;
    opacity: 0.5;
}

th.sorted-asc::after {
    content: " ↑";
    opacity: 1;
}

th.sorted-desc::after {
    content: " ↓";
    opacity: 1;
}

/* Add to admin/style.css */

/* Click count styling */
.clicks-cell {
    font-weight: bold;
    text-align: center;
}

/* Header layout with logout button */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.logout-button:hover {
    background-color: #c0392b;
}

/* Add to admin/style.css */
.delete-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.delete-button:hover {
    background-color: #c0392b;
}

/* QR Code functionality styles */
.qr-code-cell {
    text-align: center;
    min-width: 120px;
}

.qr-download-button {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 5px;
}

.qr-download-button:hover {
    background-color: #229954;
}

.qr-retry-button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.qr-retry-button:hover {
    background-color: #e67e22;
}

.qr-status {
    font-size: 11px;
    font-weight: bold;
    display: block;
}

.qr-available {
    color: #27ae60;
}

.qr-generating {
    color: #f39c12;
}

.qr-error {
    color: #e74c3c;
}

/* QR result section styles */
.qr-result {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.qr-info {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2c3e50;
}

#download-qr-button {
    margin-top: 5px;
}
