/* Plik: style.css (zaktualizowany - ciemny motyw) */
/* Data modyfikacji: 2025-07-24 18:21:16 (GMT+2) */
/* Autor: homoklikus */

body {
    font-family: 'Inter', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #1e1e1e;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1200px;
    text-align: center;
    margin: 20px auto;
    box-sizing: border-box;
}

.auth-container {
    max-width: 400px;
    margin-top: 5vh;
    margin-bottom: 5vh;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    width: 100%;
}

h1 { font-size: 2.2rem; font-weight: 700; color: #e0e0e0; margin-top: 0; margin-bottom: 10px; }
h2 { text-align: left; margin-top: 0; color: #e0e0e0; }
p { color: #a0a0a0; font-size: 1.1rem; line-height: 1.6; margin-bottom: 30px; }

.url-form, .auth-form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: flex; gap: 15px; }
.form-row .input-group { flex-grow: 1; }
.form-row input[name="delay"] { max-width: 120px; text-align: center; }

.input-group { position: relative; width: 100%; }
label { text-align: left; margin-bottom: 5px; font-weight: 500; display: block; color: #e0e0e0; }

input[type="url"], input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 1px solid #333;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #2c2c2c;
    color: #e0e0e0;
}
input:focus { 
    outline: none; 
    border-color: #2979ff; 
    box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.2); 
}

button {
    background: linear-gradient(45deg, #2979ff, #1e88e5);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
button:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); }

.result-box { margin-top: 30px; padding: 20px; border-radius: 8px; text-align: left; }
.result-box.error, .error-message { 
    background-color: rgba(220, 53, 69, 0.2); 
    border: 1px solid rgba(220, 53, 69, 0.5); 
    color: #ff6b6b; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    text-align: center; 
}
.result-box.success { 
    background-color: rgba(40, 167, 69, 0.2); 
    border: 1px solid rgba(40, 167, 69, 0.5); 
    color: #4cd964; 
}
.result-box p { margin: 0; font-size: 1rem; color: inherit; }

.short-link-wrapper { display: flex; margin-top: 10px; gap: 10px; }
.short-link-wrapper input { 
    flex-grow: 1; 
    padding: 10px; 
    font-size: 1rem; 
    border: 1px solid rgba(41, 121, 255, 0.5); 
    border-radius: 6px; 
    background-color: #2c2c2c; 
    color: #4cd964; 
    outline: none; 
}
.short-link-wrapper button { background: #2979ff; padding: 10px 15px; font-size: 1rem; flex-shrink: 0; }

.button-link { 
    display: inline-block; 
    text-decoration: none; 
    background: #424242; 
    color: white; 
    font-size: 1rem; 
    font-weight: 500; 
    padding: 10px 20px; 
    border-radius: 8px; 
    transition: background-color 0.2s; 
}
.button-link:hover { background: #616161; }

.auth-switch { text-align: center; margin-top: 20px; }
.auth-switch a { color: #2979ff; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Tabela z linkami */
.links-list { margin-top: 40px; }
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
    table-layout: fixed; 
    color: #e0e0e0; 
}
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #333; }
th { background-color: #2c2c2c; font-weight: 600; }
td a { color: #2979ff; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* Naprawione style dla długich URL-i */
.long-url-cell { 
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Link w komórce z oryginalnym URL */
.long-url-cell a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2979ff;
    text-decoration: none;
}

.long-url-cell a:hover {
    text-decoration: underline;
}

/* Style dla komórek z liczbą kliknięć */
.clicks-cell, .unique-clicks-cell {
    font-weight: 600;
    text-align: center;
    color: #e0e0e0;
}

/* Szerokości kolumn - zaktualizowane */
th:nth-child(1) { width: 10%; } /* Skrócony Link */
th:nth-child(2) { width: 25%; } /* Oryginalny URL - zmniejszona szerokość */
th:nth-child(3) { width: 10%; } /* Opóźnienie */
th:nth-child(4), th:nth-child(5) { width: 8%; } /* Kliknięcia i unikalne */
th:nth-child(6) { width: 12%; } /* Data */
th:nth-child(7) { width: 27%; } /* Akcje - zwiększona szerokość */

.actions-cell { text-align: right; white-space: nowrap; }
.action-btn { 
    display: inline-block; 
    text-decoration: none; 
    padding: 5px 8px; 
    border-radius: 5px; 
    color: white; 
    font-size: 0.85rem; 
    margin-left: 3px; 
}
.action-btn.edit { background-color: #ff9800; }
.action-btn.delete { background-color: #f44336; }
.action-btn.stats { background-color: #00bcd4; }

/* Strona przekierowania */
.redirect-container { max-width: 600px; margin-top: 10vh; }
.redirect-url { 
    font-family: monospace; 
    font-size: 1rem; 
    background: #2c2c2c; 
    padding: 10px; 
    border-radius: 6px; 
    word-break: break-all; 
}
.countdown-timer { font-size: 1.5rem; font-weight: 700; color: #2979ff; margin: 20px 0; }
.countdown-timer #countdown { font-size: 1.8rem; }
.redirect-container .button-link { background: #4caf50; }
.redirect-container .button-link:hover { background: #388e3c; }

/* Strona statystyk */
.stats-container {
    margin-top: 20px;
}

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

.stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    flex: 1;
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
}

.stats-card h3 {
    margin-top: 0;
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stats-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #2979ff;
    margin: 10px 0;
}

.stats-chart {
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.stats-table {
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Responsywność */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    tr { border: 1px solid #333; margin-bottom: 10px; }
    td { 
        border: none; 
        border-bottom: 1px solid #333; 
        position: relative; 
        padding-left: 50%; 
        text-align: left; 
        width: auto !important; 
    }
    td:before { 
        position: absolute; 
        top: 12px; 
        left: 10px; 
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap; 
        content: attr(data-label); 
        font-weight: bold; 
        text-align: left; 
        color: #a0a0a0;
    }
    .long-url-cell { 
        max-width: none;
        padding-right: 10px;
        white-space: normal;
        word-break: break-all;
    }
    .long-url-cell a {
        white-space: normal;
        word-break: break-all;
    }
    .clicks-cell, .unique-clicks-cell {
        text-align: left;
    }
    .actions-cell { text-align: left; }
    .actions-cell .action-btn { margin: 5px 5px 5px 0; display: inline-block; }
    .form-row { flex-direction: column; }
    .form-row input[name="delay"] { max-width: 100%; }
    .stats-summary { flex-direction: column; }
}

/* Style dla zakładek */
.stats-tabs {
    margin-top: 30px;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-button {
    background: transparent;
    border: none;
    color: #a0a0a0;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.tab-button:hover {
    color: #e0e0e0;
}

.tab-button.active {
    color: #2979ff;
    border-bottom: 2px solid #2979ff;
}

.tab-content {
    display: none;
    padding: 10px 0;
}

.tab-content.active {
    display: block;
}

/* Style dla wykresów */
.stats-charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-chart-box {
    flex: 1;
    min-width: 300px;
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
}

.stats-chart-box h3 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.stats-chart-box canvas {
    max-height: 300px;
}

/* Responsywność dla nowych elementów */
@media (max-width: 768px) {
    .tabs-header {
        flex-wrap: nowrap;
    }
    
    .stats-charts-row {
        flex-direction: column;
    }
    
    .stats-chart-box {
        min-width: 100%;
    }
}