* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    color: white;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content > div:first-child {
    text-align: left;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userStatus {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.btn-admin {
    transition: all 0.3s;
}

.btn-admin:hover {
    background: #5568d3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-login {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Modal */
.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-bottom: 30px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    overflow-x: auto;
}

.tab {
    padding: 15px 25px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Tab Content */
.tab-content {
    padding: 30px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-info {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Filter Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e5e7eb;
    border-radius: 50%;
    font-size: 12px;
    color: #6b7280;
    cursor: help;
    margin-left: auto;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 30px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn-create {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-create:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-copy {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-copy:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Result Section */
.result {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result.hidden {
    display: none;
}

.result h3 {
    color: #10b981;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.result-content {
    margin-bottom: 20px;
}

.result-item {
    margin-bottom: 20px;
}

.result-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.url-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-display input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f9fafb;
}

.url-display span {
    color: #6b7280;
    word-break: break-all;
}

.filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-badge.flag {
    background: #fef3c7;
    color: #92400e;
}

.filter-badge.block {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard */
.dashboard {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dashboard h3 {
    margin-bottom: 20px;
    color: #1f2937;
}

.url-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.url-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.url-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.url-item-short {
    font-weight: 600;
    color: #667eea;
    font-size: 0.95rem;
}

.url-item-clicks {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.url-item-original {
    color: #6b7280;
    font-size: 0.9rem;
    word-break: break-all;
}

.loading {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content > div:first-child {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        flex-wrap: nowrap;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .url-display {
        flex-direction: column;
        align-items: stretch;
    }
}
