/* Subnet24 Calculators - Common Styles */

/* Reset and base styles */
.subnet24-ipv4-calculator *,
.subnet24-ipv6-calculator *,
.subnet24-network-planner * {
    box-sizing: border-box;
}

/* Container */
.s24-calc-container,
.s24-planner-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    color: #1a2a3a;
    line-height: 1.6;
}

/* Headers */
.s24-calc-header,
.s24-planner-header {
    text-align: center;
    margin-bottom: 2rem;
}

.s24-calc-header h2,
.s24-planner-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1976d2;
}

.s24-subtitle {
    font-size: 1.1rem;
    color: #607d8b;
    margin: 0;
}

/* Form styles */
.s24-calc-form,
.s24-add-subnet-form {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(25, 118, 210, 0.12);
    margin-bottom: 2rem;
}

.s24-form-row {
    margin-bottom: 1.2rem;
}

.s24-form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #1a2a3a;
}

.s24-form-row input,
.s24-form-row select,
.s24-form-row textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.s24-form-row input:focus,
.s24-form-row select:focus,
.s24-form-row textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.s24-form-row input.invalid {
    border-color: #e53935;
    background: #ffebee;
}

.s24-form-row textarea {
    resize: vertical;
    min-height: 60px;
}

.s24-error-message {
    display: block;
    color: #e53935;
    font-size: 0.875rem;
    margin-top: 0.3rem;
    min-height: 1.2rem;
}

/* Buttons */
.s24-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.s24-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.s24-btn-primary {
    background: #1976d2;
    color: #fff;
}

.s24-btn-primary:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

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

.s24-btn-primary:disabled {
    background: #b0bec5;
    cursor: not-allowed;
    transform: none;
}

.s24-btn-secondary {
    background: #fff;
    color: #1976d2;
    border: 1px solid #1976d2;
}

.s24-btn-secondary:hover {
    background: #e3f2fd;
}

.s24-btn-link {
    background: none;
    border: none;
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
}

.s24-btn-link:hover {
    color: #0d47a1;
}

.s24-icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #607d8b;
    border-radius: 4px;
    transition: all 0.2s;
}

.s24-icon-btn:hover {
    background: #e3f2fd;
    color: #1976d2;
}

.s24-icon-btn.s24-delete-btn:hover {
    background: #ffebee;
    color: #e53935;
}

/* Results */
.s24-results {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(25, 118, 210, 0.12);
    margin-bottom: 2rem;
}

.s24-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.s24-results-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a2a3a;
}

.s24-results-table {
    overflow-x: auto;
}

.s24-results-table table {
    width: 100%;
    border-collapse: collapse;
    background: #f4faff;
    border-radius: 8px;
    overflow: hidden;
}

.s24-results-table th,
.s24-results-table td {
    padding: 0.8rem 1rem;
    text-align: left;
}

.s24-results-table th {
    background: #e3f2fd;
    font-weight: 600;
    color: #1a2a3a;
    width: 40%;
}

.s24-results-table td {
    color: #37474f;
}

.s24-results-table tr:not(:last-child) td {
    border-bottom: 1px solid #bbdefb;
}

.s24-small-text {
    font-size: 0.9rem;
    word-break: break-all;
}

/* History */
.s24-history {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 16px rgba(25, 118, 210, 0.12);
    margin-bottom: 2rem;
}

.s24-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.s24-history-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #1a2a3a;
}

.s24-history-actions {
    display: flex;
    gap: 0.75rem;
}

.s24-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.s24-history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.s24-history-btn {
    flex: 1;
    background: #f4faff;
    border: 1px solid #e3f2fd;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1976d2;
    transition: all 0.2s;
}

.s24-history-btn:hover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.s24-remove-btn {
    background: none;
    border: none;
    color: #e53935;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
}

.s24-remove-btn:hover {
    background: #ffebee;
}

/* Reference table */
.s24-reference-table {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(25, 118, 210, 0.12);
    margin-bottom: 2rem;
}

.s24-reference-table h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #1a2a3a;
}

.s24-table-scroll {
    overflow-x: auto;
}

.s24-reference-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.s24-reference-table thead th {
    background: #e3f2fd;
    padding: 0.8rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a2a3a;
}

.s24-reference-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #e3f2fd;
    color: #37474f;
}

.s24-reference-table tbody tr:last-child td {
    border-bottom: none;
}

.s24-reference-table tbody tr:hover {
    background: #f4faff;
}

/* Empty state */
.s24-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #607d8b;
}

.s24-empty-state svg {
    margin-bottom: 1rem;
}

.s24-empty-state h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    color: #37474f;
}

.s24-empty-state p {
    margin: 0 0 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .s24-calc-container,
    .s24-planner-container {
        padding: 1rem 0.5rem;
    }
    
    .s24-calc-form,
    .s24-add-subnet-form,
    .s24-results,
    .s24-history,
    .s24-reference-table {
        padding: 1.5rem 1rem;
    }
    
    .s24-form-actions {
        flex-direction: column;
    }
    
    .s24-btn {
        width: 100%;
        justify-content: center;
    }
    
    .s24-results-table th {
        width: 35%;
        font-size: 0.9rem;
    }
    
    .s24-results-table th,
    .s24-results-table td {
        padding: 0.6rem 0.8rem;
    }
}
