/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Navigation */
nav {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    margin: 0;
}

nav h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-tabs li a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-tabs li a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-tabs li a.active {
    background-color: #34495e;
    color: white;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main.container {
    padding: 2rem 1rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.domain-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.add-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-btn:hover {
    color: #2980b9;
}

.add-form form {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.add-form input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.add-form textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.add-form button {
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    align-self: flex-start;
}

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

#single-form {
    flex-direction: row;
}

#single-form input {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

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

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
}

table tr:hover {
    background-color: #f8f9fa;
}

table a {
    color: #3498db;
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

/* Lists */
.domains-list,
.keywords-list {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.domains-list h3,
.keywords-list h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Report Styles */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.big-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.api-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.api-notice p {
    margin: 0;
    font-size: 0.9rem;
}

.report-table {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.report-table h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

table.report {
    font-size: 0.9rem;
}

table.report th {
    background-color: #2c3e50;
    position: sticky;
    top: 0;
}

table.report .keyword-cell {
    font-weight: 500;
    position: sticky;
    left: 0;
    background: white;
}

table.report .volume-cell {
    text-align: right;
}

table.report .total-cell {
    font-weight: bold;
    text-align: right;
}

table.report tfoot th {
    background-color: #34495e;
    font-weight: bold;
}

.report-footer {
    text-align: center;
    margin-top: 2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Loading States */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .add-form form {
        flex-direction: column;
    }
    
    .actions {
        flex-wrap: wrap;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
}