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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
}

.hidden {
    display: none !important;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-box input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-box button {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.login-box button:hover {
    background: #5568d3;
}

.error-message {
    color: #ff6b6b;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

/* Admin Panel */
.admin-panel {
    min-height: 100vh;
}

.admin-header {
    background: #2c3e50;
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.btn-logout {
    padding: 8px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-logout:hover {
    background: #c0392b;
}

.admin-content {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-nav {
    width: 200px;
    background: white;
    padding: 20px 0;
    border-right: 1px solid #ddd;
    min-height: calc(100vh - 80px);
}

.nav-btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #f0f0f0;
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

.page {
    flex: 1;
    padding: 40px;
    display: none;
}

.page.active {
    display: block;
}

.page h2 {
    margin-bottom: 30px;
    color: #333;
}

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

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* Blocks List */
.blocks-list {
    display: grid;
    gap: 20px;
}

.block-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    align-items: center;
}

.block-item img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.block-item-info {
    flex: 1;
}

.block-item-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.block-item-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

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

.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #c0392b;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background: #2ecc71;
    color: white;
}

.badge-inactive {
    background: #95a5a6;
    color: white;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}

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

.modal-content h2 {
    margin-bottom: 30px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-content label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 500;
    color: #333;
}

.modal-content input,
.modal-content textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.modal-content input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.modal-content small {
    display: block;
    color: #666;
    font-size: 13px;
    margin-top: 5px;
}

#image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    text-align: center;
}

#image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.modal-content textarea {
    resize: vertical;
}

.checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Top Blocks List */
.top-blocks-list {
    display: grid;
    gap: 15px;
}

.top-block-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-block-item h3 {
    margin-bottom: 5px;
    color: #333;
}

.top-block-item p {
    color: #666;
    font-size: 14px;
}

.top-block-clicks {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

