/* Rotamap Integration UI Styles */

:root {
    --primary-color: #005eb8;
    --primary-hover: #003f7a;
    --secondary-color: #41b6e6;
    --success-color: #007f3b;
    --error-color: #da291c;
    --warning-color: #ffb81c;
    --bg-color: #f0f4f5;
    --card-bg: #ffffff;
    --text-color: #212b32;
    --text-secondary: #425563;
    --border-color: #d8dde0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab-button:hover {
    background: var(--bg-color);
}

.tab-button.active {
    background: var(--card-bg);
    border-bottom-color: var(--card-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-secondary.active {
    background: var(--primary-color);
    color: white;
}

.result-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.result-message.success {
    background: #e8f5e9;
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
    display: block;
}

.result-message.error {
    background: #ffebee;
    border-left: 4px solid var(--error-color);
    color: var(--error-color);
    display: block;
}

.result-message.info {
    background: #e3f2fd;
    border-left: 4px solid var(--secondary-color);
    color: var(--primary-color);
    display: block;
}

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

.view-data-header h2 {
    margin-bottom: 0;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-danger:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

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

.modal {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
}

.modal h3 {
    color: var(--error-color);
    margin-bottom: 16px;
}

.modal p {
    margin-bottom: 12px;
    color: var(--text-color);
}

.modal input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 20px;
}

.modal input:focus {
    outline: none;
    border-color: var(--error-color);
}

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

.data-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.table-controls input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    white-space: nowrap;
    font-size: 0.85rem;
}

table td {
    font-size: 0.9rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table td:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

table th {
    background: var(--bg-color);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background: var(--bg-color);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        border-radius: 6px;
    }

    .table-controls {
        flex-direction: column;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 8px;
    }
}
