:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #f8f9fa;
    --text: #333;
    --text-light: #6c757d;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --border: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-theme {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #343a40;
    --text: #f8f9fa;
    --text-light: #adb5bd;
    --bg: #212529;
    --bg-secondary: #343a40;
    --border: #495057;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 120px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 100;
}

.logo-container {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo i {
    font-size: 28px;
}

.user-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

.user-name {
    font-weight: bold;
    display: block;
}

.user-username {
    font-size: 10px;
    opacity: 0.8;
    display: block;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-item i {
    font-size: 22px;
}

.nav-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    z-index: 1000;
    margin-left: 10px;
}

.nav-item:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
}

.notification-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.theme-toggle {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: var(--transition);
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.page {
    display: none;
    width: 100%;
    max-width: 600px;
    height: 80vh;
}

.page.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dialer-container, .sms-container, .history-container, .contacts-container, .voicemails-container, .recordings-container {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

.dialer-title, .sms-title, .history-title, .contacts-title, .voicemails-title, .recordings-title {
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary);
}

.dialer-title i, .sms-title i, .history-title i, .contacts-title i, .voicemails-title i, .recordings-title i {
    font-size: 26px;
}

/* Dialer Page Styles */
.number-input-container {
    position: relative;
    margin-bottom: 20px;
}

.number-input {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 15px 50px 15px 20px;
    font-size: 28px;
    width: 100%;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
    letter-spacing: 2px;
    color: var(--text);
    font-family: 'Courier New', monospace;
}

.number-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.country-code {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 20px;
    font-weight: 600;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.number-btn {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 26px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    user-select: none;
    color: var(--text);
}

.number-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.number-btn:active {
    transform: scale(0.95);
}

.number-btn .sub-text {
    font-size: 9px;
    margin-top: 2px;
    font-weight: normal;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.action-btn {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    user-select: none;
}

.action-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.clear {
    background-color: #f39c12;
    color: white;
    border-color: #f39c12;
}

.action-btn.clear:hover {
    background-color: #e67e22;
    border-color: #e67e22;
}

.action-btn.backspace {
    background-color: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.action-btn.backspace:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

.call-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: auto;
}

.call-btn {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    user-select: none;
}

.call-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn.call {
    background-color: #2ecc71;
    color: white;
    border-color: #2ecc71;
}

.call-btn.call:hover {
    background-color: #27ae60;
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.call-btn.hangup {
    background-color: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.call-btn.hangup:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.call-btn.mute {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.call-btn.mute:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.call-btn.muted {
    background-color: #e67e22;
}

.call-btn.muted:hover {
    background-color: #d35400;
}

.call-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.dtmf-controls {
    display: none;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.dtmf-controls.active {
    display: flex;
}

.dtmf-btn {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    user-select: none;
    min-width: 50px;
}

.dtmf-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.status {
    padding: 12px;
    margin: 15px 0;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
}

.status.ready {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border-color: rgba(46, 204, 113, 0.2);
}

.status.calling {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
    border-color: rgba(241, 196, 15, 0.2);
}

.status.connected {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border-color: rgba(52, 152, 219, 0.2);
}

.status.incoming {
    background-color: rgba(155, 89, 182, 0.1);
    color: #8e44ad;
    border-color: rgba(155, 89, 182, 0.2);
}

.status.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border-color: rgba(231, 76, 60, 0.2);
}

/* SMS Page Styles */
.sms-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.back-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* SMS Header with New Chat button */
.sms-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.sms-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-chat-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.new-chat-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.sms-conversations {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
    padding-right: 5px;
}

.sms-conversations::-webkit-scrollbar {
    width: 6px;
}

.sms-conversations::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.sms-conversations::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
}

.conversation-item:hover {
    background-color: rgba(231, 76, 60, 0.05);
    border-color: var(--primary);
}

.conversation-item.active {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: var(--primary);
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-last-message {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.conversation-unread {
    background-color: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.sms-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sms-chat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    flex-shrink: 0;
}

.sms-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.sms-chat-info {
    flex: 1;
    min-width: 0;
}

.sms-chat-name {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sms-chat-number {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-x: hidden;
}

.sms-messages::-webkit-scrollbar {
    width: 6px;
}

.sms-messages::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.sms-messages::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: messageAppear 0.3s ease;
    line-height: 1.4;
}

@keyframes messageAppear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-bottom-right-radius: 5px;
}

.dark-theme .message.sent {
    background: linear-gradient(135deg, #27ae60, #219653);
}

.message.received {
    align-self: flex-start;
    background-color: var(--bg);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--border);
}

.message-content {
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 5px;
    text-align: right;
    opacity: 0.8;
}

.message.received .message-time {
    text-align: left;
    color: var(--text-light);
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.sms-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 0 0 15px 15px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sms-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 25px;
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    resize: none;
    min-height: 50px;
    max-height: 100px;
    font-family: inherit;
}

.sms-input:focus {
    outline: none;
    border-color: var(--primary);
}

.sms-send-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sms-send-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

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

.no-conversations, .no-contacts, .no-voicemails, .no-recordings {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-conversations i, .no-contacts i, .no-voicemails i, .no-recordings i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.start-chat-btn, .add-contact-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.start-chat-btn:hover, .add-contact-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Contacts Page Styles */
.contacts-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.contacts-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-contact-btn {
    padding: 10px 20px;
    font-size: 14px;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
    padding-right: 5px;
}

.contacts-list::-webkit-scrollbar {
    width: 6px;
}

.contacts-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.contacts-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.contact-item:hover {
    background-color: rgba(231, 76, 60, 0.05);
    border-color: var(--primary);
}

.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-phone {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.contact-call-btn, .contact-sms-btn, .contact-edit-btn, .contact-delete-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-call-btn:hover, .contact-sms-btn:hover, .contact-edit-btn:hover, .contact-delete-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.contact-sms-btn {
    background-color: #3498db;
}

.contact-sms-btn:hover {
    background-color: #2980b9;
}

.contact-edit-btn {
    background-color: #f39c12;
}

.contact-edit-btn:hover {
    background-color: #e67e22;
}

.contact-delete-btn {
    background-color: #e74c3c;
}

.contact-delete-btn:hover {
    background-color: #c0392b;
}

/* Contact Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.contact-modal {
    background-color: var(--bg);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-modal:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

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

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text);
}

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

/* Voicemails Page Styles */
.voicemails-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.voicemails-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background-color: var(--bg);
    border-radius: 10px;
    min-width: 80px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.voicemails-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 50vh;
    padding-right: 5px;
}

.voicemails-list::-webkit-scrollbar {
    width: 6px;
}

.voicemails-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.voicemails-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.voicemail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.voicemail-item:hover {
    background-color: rgba(231, 76, 60, 0.05);
    border-color: var(--primary);
}

.voicemail-item.unread {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.voicemail-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.voicemail-info {
    flex: 1;
    min-width: 0;
}

.voicemail-caller {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voicemail-details {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voicemail-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.voicemail-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.voicemail-play-btn, .voicemail-download-btn, .voicemail-delete-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voicemail-play-btn:hover, .voicemail-download-btn:hover, .voicemail-delete-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.voicemail-play-btn {
    background-color: #2ecc71;
}

.voicemail-play-btn:hover {
    background-color: #27ae60;
}

.voicemail-download-btn {
    background-color: #3498db;
}

.voicemail-download-btn:hover {
    background-color: #2980b9;
}

.voicemail-delete-btn {
    background-color: #e74c3c;
}

.voicemail-delete-btn:hover {
    background-color: #c0392b;
}

/* Audio Player */
.audio-player {
    width: 100%;
    margin-top: 10px;
}

.audio-player audio {
    width: 100%;
}

/* Recordings Page Styles */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
    padding-right: 5px;
}

.recordings-list::-webkit-scrollbar {
    width: 6px;
}

.recordings-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.recordings-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg);
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.recording-item:hover {
    background-color: rgba(231, 76, 60, 0.05);
    border-color: var(--primary);
}

.recording-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.recording-info {
    flex: 1;
    min-width: 0;
}

.recording-from {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-details {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.recording-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.recording-play-btn, .recording-download-btn, .recording-delete-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recording-play-btn:hover, .recording-download-btn:hover, .recording-delete-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.recording-play-btn {
    background-color: #2ecc71;
}

.recording-play-btn:hover {
    background-color: #27ae60;
}

.recording-download-btn {
    background-color: #3498db;
}

.recording-download-btn:hover {
    background-color: #2980b9;
}

.recording-delete-btn {
    background-color: #e74c3c;
}

.recording-delete-btn:hover {
    background-color: #c0392b;
}

/* Call History Page */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
    padding-right: 5px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.history-item {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.history-item:hover {
    background-color: rgba(231, 76, 60, 0.05);
    border-color: var(--primary);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-number {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
}

.history-type {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin: 0 10px;
    flex-shrink: 0;
}

.history-type.outgoing {
    background-color: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.history-type.incoming {
    background-color: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

.history-type.missed {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.history-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.history-call-btn, .history-sms-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-call-btn:hover, .history-sms-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.history-sms-btn {
    background-color: #3498db;
}

.history-sms-btn:hover {
    background-color: #2980b9;
}

.clear-history-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.clear-history-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast i {
    font-size: 20px;
}

/* Incoming Call Alert */
.incoming-call-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    text-align: center;
    z-index: 2000;
    border: 4px solid #8e44ad;
    animation: ring 0.8s infinite alternate;
    width: 90%;
    max-width: 350px;
}

.dark-theme .incoming-call-alert {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
}

.incoming-call-alert h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 24px;
}

.incoming-call-alert .caller-id {
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
    color: white;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.incoming-call-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.alert-btn {
    background-color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.alert-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.alert-btn.answer {
    color: #2ecc71;
}

.alert-btn.reject {
    color: #e74c3c;
}

@keyframes ring {
    0% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1.05) rotate(1deg);
    }
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
    }
    
    .logo-container {
        padding: 0 20px;
        border-bottom: none;
        border-right: 1px solid var(--border);
        width: auto;
    }
    
    .logo span {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        padding: 0;
        flex: 1;
    }
    
    .nav-item {
        flex: 1;
        padding: 0;
        height: 100%;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--primary);
    }
    
    .nav-tooltip {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
        margin-top: 10px;
    }
    
    .theme-toggle {
        padding: 0 20px;
        border-top: none;
        border-left: 1px solid var(--border);
        width: auto;
    }
    
    .main-content {
        padding: 15px;
        height: calc(100vh - 60px);
    }
    
    .page {
        height: 100%;
        max-width: 100%;
    }
    
    .dialer-container, .sms-container, .history-container, .contacts-container, .voicemails-container, .recordings-container {
        padding: 15px;
    }
    
    .number-btn {
        width: 65px;
        height: 65px;
        font-size: 24px;
    }
    
    .number-input {
        font-size: 24px;
        padding: 12px 45px 12px 15px;
    }
    
    .country-code {
        font-size: 18px;
        left: 10px;
    }
    
    .action-btn {
        width: 55px;
        height: 55px;
    }
    
    .call-btn {
        width: 65px;
        height: 65px;
    }
    
    .dtmf-btn {
        padding: 8px 15px;
        font-size: 16px;
        min-width: 45px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .conversation-last-message {
        max-width: 150px;
    }
    
    .sms-header-actions, .contacts-header-actions, .voicemails-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .new-chat-btn, .add-contact-btn {
        align-self: flex-start;
    }
    
    .voicemails-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-item {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .number-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
    
    .number-grid {
        gap: 8px;
    }
    
    .call-controls {
        gap: 12px;
    }
    
    .call-btn {
        width: 60px;
        height: 60px;
    }
    
    .number-input {
        font-size: 22px;
        padding: 10px 40px 10px 12px;
    }
    
    .country-code {
        font-size: 16px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .conversation-last-message {
        max-width: 120px;
    }
    
    .sms-header-actions, .contacts-header-actions {
        flex-direction: column;
    }
    
    .new-chat-btn, .add-contact-btn {
        width: 100%;
        justify-content: center;
    }
    
    .contact-actions, .voicemail-actions, .recording-actions {
        gap: 5px;
    }
    
    .contact-call-btn, .contact-sms-btn, .contact-edit-btn, .contact-delete-btn,
    .voicemail-play-btn, .voicemail-download-btn, .voicemail-delete-btn,
    .recording-play-btn, .recording-download-btn, .recording-delete-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}