/* Modern CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding-bottom: 2rem;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
}

input, select, textarea, button {
    border: none;
    outline: none;
    background: transparent;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 12px;
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-button.active {
    background: white;
    color: #25D366;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Headings */
h2 {
    color: #25D366;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Styles */
.form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input[type="text"]:focus, select:focus, textarea:focus {
    border-color: #25D366;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

input[type="text"]:hover, select:hover, textarea:hover {
    border-color: #c5cacf;
}

/* Message Mode Selector */
.message-mode-selector {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-mode-selector:focus {
    border-color: #25D366;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

/* Error Messages */
.error-message {
    display: block;
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #e1e5eb;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Result Containers */
.result-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #25D366;
}

.result-container h3 {
    margin-bottom: 1.25rem;
    color: #25D366;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-container.hidden {
    display: none;
}

/* Link Display */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-display input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Table Styles */
.table-controls {
    margin-bottom: 1.5rem;
    text-align: right;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

th {
    background: #f1f8f5;
    color: #25D366;
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #e1e5eb;
}

th i {
    margin-right: 0.5rem;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e1e5eb;
}

tr:hover td {
    background: #f5fff9;
}

tr:last-child td {
    border-bottom: none;
}

.action-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 992px) {
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .form-col {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1.5rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .table-controls {
        text-align: center;
    }
    
    th, td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-container {
    animation: fadeIn 0.5s ease forwards;
}