/**
 * CSS za Dinamičku Oglasnu Tablu
 * Moderni dizajn sa gradijentima i lepom color palettom
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Moderna color paleta */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --header-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --card-gradient: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --stats-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Boje */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: var(--header-gradient);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

header .container {
    position: relative;
    z-index: 1;
}

/* Header Content */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Logo */
.logo-container {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, opacity 0.3s;
}

.logo-link:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.logo-icon {
    font-size: 2.5rem;
    margin-right: 0.75rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    margin-bottom: 0.15rem;
}

.logo-tagline {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-end;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main */
main {
    min-height: 70vh;
}

/* Statistika */
.statistics {
    background: var(--card-gradient);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.statistics h2 {
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-item ul {
    margin-top: 0.75rem;
    margin-left: 1.5rem;
    list-style: none;
}

.stat-item ul li::before {
    content: '▸ ';
    color: var(--primary-color);
    font-weight: bold;
}

.stat-item li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* Proširena statistika */
.extended-stats {
    margin-bottom: 2rem;
}

.detailed-banners-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.banners-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.banners-table thead {
    background: var(--primary-gradient);
    color: white;
}

.banners-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.banners-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.banners-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

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

.banners-table td {
    padding: 1rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.price-cell {
    font-weight: 600;
}

.price-paid {
    color: #059669;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.price-free {
    color: #7c3aed;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.table-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    word-break: break-all;
    transition: color 0.2s;
}

.table-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.expires-cell {
    position: relative;
}

.expiring-soon {
    background-color: rgba(251, 191, 36, 0.1) !important;
}

.expiring-soon:hover {
    background-color: rgba(251, 191, 36, 0.2) !important;
}

.expiring-soon-text {
    color: #d97706;
    font-weight: 600;
}

.expiring-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Beta/Testing Warning */
.beta-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 2px solid #f59e0b;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.beta-warning p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #dc2626;
    font-weight: 600;
}

.beta-warning strong {
    color: #dc2626;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Site Description */
.site-description {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.site-description p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.site-description strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Banner Board */
.banner-board {
    background: var(--card-gradient);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.banner-board h2 {
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(10, 100px);
    gap: 3px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    padding: 3px;
    border-radius: 12px;
    width: 1033px; /* 10 kolona × 100px = 1000px + 9 gap-ova × 3px = 27px + padding 3px × 2 = 6px = 1033px */
    margin: 0 auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: content-box; /* Padding se ne uključuje u width */
}

.banner-slot {
    width: 100px;
    height: 50px;
    min-width: 100px;
    min-height: 50px;
    background-color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.banner-slot:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.banner-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    border-radius: 6px;
    overflow: hidden;
}

.banner-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.banner-link:hover img {
    transform: scale(1.1);
}

.banner-price {
    display: none; /* Skriveno - ne prikazujemo cenu */
}

.empty-slot {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px dashed #cbd5e0;
    transition: all 0.3s;
}

.banner-slot:hover .empty-slot {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.banner-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Forme */
.auth-form, .banner-form {
    max-width: 500px;
    margin: 2rem auto;
    background: var(--card-gradient);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.auth-form h2, .banner-form h2 {
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #94a3b8 100%);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-group .btn {
    width: auto;
    flex: 1;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #22c55e;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Position Preview */
.position-preview,
.image-preview {
    margin-top: 0.75rem;
}

.position-result {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 1rem;
    border-radius: 8px;
    color: #166534;
    font-weight: 600;
    border-left: 4px solid #22c55e;
}

.loading {
    color: var(--text-light);
    font-style: italic;
}

.error {
    color: #dc2626;
}

/* My Banners */
.my-banners {
    background: var(--card-gradient);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.banners-list {
    display: grid;
    gap: 1.5rem;
}

.banner-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.banner-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.banner-preview {
    width: 150px;
    height: 75px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info h3 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 700;
}

.banner-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.banner-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.banner-info a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.banner-actions .btn {
    color: white !important;
    text-decoration: none;
}

.banner-actions .btn:hover {
    color: white !important;
    text-decoration: none;
}

.banner-type-paid {
    color: #059669;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.banner-type-free {
    color: #7c3aed;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.status-pending {
    color: #f59e0b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.status-active {
    color: #10b981;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.status-expired {
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.status-rejected {
    color: #ef4444;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* How It Works Section */
.how-it-works {
    background: var(--card-gradient);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.how-it-works h2 {
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

.explanation-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.explanation-box.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left-color: var(--secondary-color);
}

.explanation-box.warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left-color: #ef4444;
}

.explanation-box.important {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-left-color: #f59e0b;
}

.explanation-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.explanation-box p {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-size: 1rem;
}

.explanation-box ul,
.explanation-box ol {
    margin: 1rem 0;
    padding-left: 2rem;
    line-height: 1.8;
}

.explanation-box li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.explanation-box strong {
    color: var(--primary-color);
    font-weight: 600;
}

.explanation-box ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--header-gradient);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 1100px) {
    .banner-grid {
        grid-template-columns: repeat(10, 1fr);
        width: 100%;
        max-width: 1033px;
    }
    
    .banner-slot {
        width: 100%;
        aspect-ratio: 2 / 1;
        min-width: 0;
    }

    .banners-table {
        font-size: 0.85rem;
    }

    .banners-table th,
    .banners-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo-container {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .logo-title {
        font-size: 1.5rem;
    }
    
    .logo-tagline {
        font-size: 0.75rem;
    }
    
    header nav {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    header nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .banner-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .banner-item {
        grid-template-columns: 1fr;
    }

    .banner-preview {
        width: 100%;
        max-width: 200px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .statistics h2,
    .banner-board h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .banner-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .auth-form, .banner-form {
        padding: 1.5rem;
    }
}
