/* Twaino Tools — Common Styles */
/* Namespace: .tw-tools- */

/* === Reset & Base === */
.tw-tools-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #010643;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.tw-tools-container *,
.tw-tools-container *::before,
.tw-tools-container *::after {
    box-sizing: border-box;
}

/* === Typography === */
.tw-tools-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #010643;
    margin: 0 0 0.5rem;
}

.tw-tools-subtitle {
    font-size: 1rem;
    color: #555;
    margin: 0 0 1.5rem;
}

/* === Form Inputs === */
.tw-tools-input,
.tw-tools-textarea,
.tw-tools-select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #010643;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s ease;
    outline: none;
}

.tw-tools-input:focus,
.tw-tools-textarea:focus,
.tw-tools-select:focus {
    border-color: #9FFDCE;
    box-shadow: 0 0 0 3px rgba(159, 253, 206, 0.3);
}

.tw-tools-textarea {
    min-height: 120px;
    resize: vertical;
}

.tw-tools-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #010643;
    margin-bottom: 0.375rem;
}

.tw-tools-form-group {
    margin-bottom: 1.25rem;
}

/* === Buttons === */
.tw-tools-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.tw-tools-btn-primary {
    background: #010643;
    color: #fff;
}

.tw-tools-btn-primary:hover {
    background: #020a6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 6, 67, 0.25);
}

.tw-tools-btn-secondary {
    background: #9FFDCE;
    color: #010643;
}

.tw-tools-btn-secondary:hover {
    background: #7ff5b8;
    transform: translateY(-1px);
}

.tw-tools-btn-outline {
    background: transparent;
    color: #010643;
    border: 2px solid #010643;
}

.tw-tools-btn-outline:hover {
    background: #010643;
    color: #fff;
}

.tw-tools-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.tw-tools-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* === Tabs === */
.tw-tools-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tw-tools-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #777;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tw-tools-tab:hover {
    color: #010643;
}

.tw-tools-tab.tw-tools-tab-active {
    color: #010643;
    border-bottom-color: #9FFDCE;
}

.tw-tools-tab-content {
    display: none;
}

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

/* === Loading Spinner === */
.tw-tools-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.tw-tools-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #9FFDCE;
    border-radius: 50%;
    animation: tw-tools-spin 0.7s linear infinite;
}

@keyframes tw-tools-spin {
    to { transform: rotate(360deg); }
}

.tw-tools-loading-text {
    margin-left: 0.75rem;
    font-size: 0.9375rem;
    color: #777;
}

/* === Cards & Panels === */
.tw-tools-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tw-tools-card-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: #010643;
    margin: 0 0 0.75rem;
}

/* === Results / Stats === */
.tw-tools-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tw-tools-stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.tw-tools-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #010643;
    line-height: 1.2;
}

.tw-tools-stat-label {
    display: block;
    font-size: 0.8125rem;
    color: #777;
    margin-top: 0.25rem;
}

/* === Alerts === */
.tw-tools-alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.tw-tools-alert-success {
    background: #e8fff2;
    color: #065f2b;
    border: 1px solid #9FFDCE;
}

.tw-tools-alert-error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.tw-tools-alert-info {
    background: #f0f4ff;
    color: #010643;
    border: 1px solid #d0d9f0;
}

/* === Responsive Grid === */
.tw-tools-grid {
    display: grid;
    gap: 1rem;
}

.tw-tools-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tw-tools-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .tw-tools-container {
        padding: 1rem 0.75rem;
    }

    .tw-tools-grid-2,
    .tw-tools-grid-3 {
        grid-template-columns: 1fr;
    }

    .tw-tools-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tw-tools-tabs {
        overflow-x: auto;
    }

    .tw-tools-title {
        font-size: 1.375rem;
    }
}

@media (max-width: 480px) {
    .tw-tools-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* === Table === */
.tw-tools-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.tw-tools-table th,
.tw-tools-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.tw-tools-table th {
    font-weight: 600;
    color: #010643;
    background: #f8f9fa;
}

.tw-tools-table tr:hover td {
    background: #f8f9fa;
}

/* === Copy Button === */
.tw-tools-copy-btn {
    position: relative;
}

.tw-tools-copy-btn.tw-tools-copied::after {
    content: 'Copie !';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #010643;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    animation: tw-tools-fade-out 1.5s forwards;
}

@keyframes tw-tools-fade-out {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}
