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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Main Content */
.main-content {
    padding: 0 1rem 3rem;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.section-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Countries Grid */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Country Card */
.country-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.country-card:active {
    transform: translateY(-2px);
}

/* Flag Styling */
.flag {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Country Info */
.country-info {
    flex: 1;
}

.country-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.country-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Arrow */
.arrow {
    color: #6c757d;
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.country-card:hover .arrow {
    transform: translateX(3px);
    color: #007bff;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .countries-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .country-card {
        padding: 1.25rem;
    }
    
    .flag {
        width: 40px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.2rem;
    }
    .hero-subtitle {
        font-size: 0.8rem;
    }
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 2rem 0 1.5rem;
    }
    
    .hero-features {
        align-items: center;
        gap: 0.5rem;
    }

    .feature-tag {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Page Header */
.page-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #f8f9fa;
    transform: translateX(-3px);
}

.country-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flag-large {
    width: 64px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

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

.country-header p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Numbers Grid */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Number Card */
.number-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.number-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.number-main {
    flex: 1;
}

.number-main h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.number-main p {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.number-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Status Badges */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

/* Message Count */
.message-count {
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Loading Skeletons */
.loading-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flag-skeleton {
    width: 64px;
    height: 48px;
    background: #e9ecef;
    border-radius: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

.text-skeleton {
    width: 200px;
    height: 20px;
    background: #e9ecef;
    border-radius: 4px;
    animation: pulse 1.5s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

.text-skeleton.short {
    width: 120px;
    height: 16px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* No Numbers State */
.no-numbers {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    grid-column: 1 / -1;
}

.no-numbers h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Responsive Design for Numbers Page */
@media (max-width: 768px) {
    .page-header {
        padding: 1.5rem;
    }
    
    .numbers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .number-card {
        padding: 1.25rem;
    }
    
    .country-header h1 {
        font-size: 1.75rem;
    }
    
    .flag-large {
        width: 56px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1.25rem;
    }
    
    .number-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .number-status {
        align-self: flex-end;
    }
}

/* -----------------------------------------
    inside a phone number
-------------------------------------------- */

/* Number Header */
.number-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.number-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.number-header p {
    color: #6c757d;
    margin: 0;
}

/* Messages Section */
.messages-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.messages-header h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

/* Refresh Button */
.refresh-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

/* Messages Container */
.messages-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message Styles */
.message {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.message:hover {
    background: #f1f3f4;
    transform: translateX(5px);
}

.message.verification {
    border-left-color: #28a745;
    background: #f8fff9;
}

.message.promotional {
    border-left-color: #ffc107;
    background: #fffef0;
}

.message.transactional {
    border-left-color: #6f42c1;
    background: #f8f9ff;
}

.message.demo {
    border-left-color: #fd7e14;
    background: #fff4e6;
}

/* New Message Animation */
.message.new-message {
    animation: slideInDown 0.5s ease-out;
    background: #e7f3ff;
    border-left-color: #17a2b8;
}

/* Message Header */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.message-header strong {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.message-header span {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Message Content */
.message-content {
    color: #495057;
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.message-content strong {
    color: #e83e8c;
    font-weight: 600;
}

/* No Messages State */
.no-messages {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-messages h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.no-messages p {
    margin: 0;
}

/* Demo Controls */
.demo-controls {
    text-align: center;
    padding: 2rem 0 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

.simulate-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.simulate-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

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

.demo-note {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* New Message Notification */
.new-message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design for Messages */
@media (max-width: 768px) {
    .messages-section {
        padding: 1.5rem;
    }
    
    .messages-header {
        /* flex-direction: column; */
        gap: 1rem;
        align-items: flex-start;
    }
    
    .messages-header h2 {
        font-size: 1.3rem;
    }
    
    .message {
        padding: 1rem;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .number-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .messages-header h2 {
        font-size: 1rem;
    }
    .refresh-btn {
        padding: 0.5rem 1rem;
    }
    .messages-section {
        padding: 1.25rem;
    }
    
    .demo-controls {
        padding: 1.5rem 0 0.5rem;
    }
    
    .simulate-btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}